Skip to content

Commit

Permalink
Merge pull request #19 from betacraft/RUB-27
Browse files Browse the repository at this point in the history
RUB-27 Rename usages of RubyVernacParser to RubyvernacCore
  • Loading branch information
ashish91 authored Oct 17, 2023
2 parents 716ed06 + c487189 commit 0816e9b
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

# Specify your gem's dependencies in ruby-vernac-parser.gemspec
# Specify your gem's dependencies in rubyvernac-core.gemspec
gemspec

gem 'rake', '~> 10.3.2'
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
ruby-vernac-parser (0.0.1)
rubyvernac-core (0.0.1)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -97,7 +97,7 @@ DEPENDENCIES
rspec (~> 3.12)
rspec-expectations (~> 3.12)
rspec-mocks (~> 3.12)
ruby-vernac-parser!
rubyvernac-core!
yaml (~> 0.2.0)

BUNDLED WITH
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ruby-vernac-parser
# rubyvernac-core

## Installation

Expand All @@ -11,9 +11,9 @@ Install dependencies:


```ruby
require "ruby-vernac-parser"
require "rubyvernac-core"

parser = RubyVernacParser.new(source_file: <path to source>,
parser = RubyvernacCore.new(source_file: <path to source>,
language: <programing-language: "ruby">, keywords_file: <path to keywords file>)

parser.execute #Execute the parsed script
Expand Down
4 changes: 2 additions & 2 deletions keyword_parser.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require_relative "./lib/ruby-vernac-parser"
require_relative "./lib/rubyvernac-core"

RubyVernacParser.new(
RubyvernacCore.new(
source_file: ARGV[0],
language: ARGV[1],
keywords_file: ARGV[2],
Expand Down
2 changes: 1 addition & 1 deletion lib/ruby-vernac-parser.rb → lib/rubyvernac-core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
require_relative "./rubyvernac/utils/file_handler"
require_relative "./rubyvernac/utils/yaml_handler"

class RubyVernacParser
class RubyvernacCore
extend Forwardable

def_delegators :@language_alias_loader, :create_aliases
Expand Down
4 changes: 2 additions & 2 deletions lib/rubyvernac/generators/template_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ def generate_gem_from_template(template_files)

# Replaces template file path with gem path:
#
# "~/ruby-vernac-parser/lib/templates/Gemfile"
# "~/rubyvernac-core/lib/templates/Gemfile"
# becomes
# "~/ruby-vernac-parser/new_gems/rubyvernac-hindi/Gemfile"
# "~/rubyvernac-core/new_gems/rubyvernac-hindi/Gemfile"
# replacing /lib/templates with /new_gems/rubyvernac-hindi
#
# this preserves the sub path of the file in templates folder.
Expand Down
2 changes: 1 addition & 1 deletion lib/templates/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ gem "yaml", "~> 0.2"
gem "dotenv", "~> 2.8"
gem "google-cloud-translate-v3", "~> 0.5"

gem 'ruby-vernac-parser', git: 'https://github.com/betacraft/ruby-vernac-parser', branch: "main"
gem 'rubyvernac-core', git: 'https://github.com/betacraft/rubyvernac-core', branch: "main"

group :development do
gem "pry-nav", "~> 1.0"
Expand Down
6 changes: 3 additions & 3 deletions lib/templates/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
GIT
remote: https://github.com/betacraft/ruby-vernac-parser
remote: https://github.com/betacraft/rubyvernac-core
revision: aee855a404e6d6ae8a98de2ca00280c8f414b5ef
branch: main
specs:
ruby-vernac-parser (0.0.1)
rubyvernac-core (0.0.1)

PATH
remote: .
Expand Down Expand Up @@ -80,7 +80,7 @@ DEPENDENCIES
google-cloud-translate-v3 (~> 0.5)
pry-nav (~> 1.0)
rake (~> 13.0)
ruby-vernac-parser!
rubyvernac-core!
rubyvernac-hindi!
yaml (~> 0.2)

Expand Down
4 changes: 2 additions & 2 deletions lib/templates/bin/ruby___lang__.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
require "bundler"
require "bundler/setup"

require "ruby-vernac-parser"
require "rubyvernac-core"

if ARGV.size < 1
puts "Provide a script file"
else
spec = Gem::Specification.find_by_name("rubyvernac-__lang__")
keyword_file_path = spec.gem_dir + "/lib/translations/keywords.yml"

parser = RubyVernacParser.new(
parser = RubyvernacCore.new(
source_file: ARGV[0],
keywords_file: keyword_file_path
)
Expand Down
4 changes: 2 additions & 2 deletions lib/templates/lib/rubyvernac-__lang__.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
require 'rubyvernac/__lang__'
require 'ruby-vernac-parser'
require 'rubyvernac-core'

require 'yaml'

spec = Gem::Specification.find_by_name("rubyvernac-__lang__")
gem_root = spec.gem_dir

parser = RubyVernacParser.new
parser = RubyvernacCore.new
parser.create_aliases(gem_root + '/lib/translations/classes')
10 changes: 5 additions & 5 deletions ruby-vernac-parser.gemspec → rubyvernac-core.gemspec
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# frozen_string_literal: true

require_relative "lib/ruby-vernac-parser"
require_relative "lib/rubyvernac-core"

Gem::Specification.new do |spec|
spec.name = "ruby-vernac-parser"
spec.name = "rubyvernac-core"
spec.version = "0.0.1"
spec.authors = ["Mathew Thomas"]
spec.email = ["mathew@betacraft.io"]

spec.summary = "Write a short summary, because RubyGems requires one."
spec.homepage = "https://github.com/betacraft/ruby-vernac-parser"
spec.homepage = "https://github.com/betacraft/rubyvernac-core"
spec.license = "MIT"
spec.required_ruby_version = ">= 2.7"

spec.metadata["homepage_uri"] = "https://github.com/betacraft/ruby-vernac-parser"
spec.metadata["source_code_uri"] = "https://github.com/betacraft/ruby-vernac-parser"
spec.metadata["homepage_uri"] = "https://github.com/betacraft/rubyvernac-core"
spec.metadata["source_code_uri"] = "https://github.com/betacraft/rubyvernac-core"

# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RSpec.describe RubyVernacParser do
RSpec.describe RubyvernacCore do
subject do
RubyVernacParser.new(
RubyvernacCore.new(
source_file: Dir.pwd + '/spec/stubs/ruby_vernac_parser/example.rb',
keywords_file: Dir.pwd + '/spec/stubs/ruby_vernac_parser/keywords.yml'
)
Expand All @@ -13,7 +13,7 @@
end

describe "#execute" do
it "" do
it "executes a script in non eng language" do
expect{ subject.execute }.to output("Script Output -\n२ सरकार।\n").to_stdout
end
end
Expand Down

0 comments on commit 0816e9b

Please sign in to comment.