From d649b451f6a2c61964f7570e144436e31105be7d Mon Sep 17 00:00:00 2001 From: Ashish Gaur Date: Mon, 16 Oct 2023 15:59:44 +0530 Subject: [PATCH] RUB-27 Rename usages of RubyVernacParser to RUbyvernacCore --- Gemfile | 2 +- README.md | 6 +++--- keyword_parser.rb | 4 ++-- lib/{ruby-vernac-parser.rb => rubyvernac-core.rb} | 2 +- lib/rubyvernac/generators/template_generator.rb | 4 ++-- lib/templates/Gemfile | 2 +- lib/templates/bin/ruby___lang__.txt | 4 ++-- lib/templates/lib/rubyvernac-__lang__.rb | 4 ++-- ruby-vernac-parser.gemspec => rubyvernac-core.gemspec | 10 +++++----- ...y_vernac_parser_spec.rb => rubyvernac_core_spec.rb} | 6 +++--- 10 files changed, 22 insertions(+), 22 deletions(-) rename lib/{ruby-vernac-parser.rb => rubyvernac-core.rb} (98%) rename ruby-vernac-parser.gemspec => rubyvernac-core.gemspec (86%) rename spec/{ruby_vernac_parser_spec.rb => rubyvernac_core_spec.rb} (85%) diff --git a/Gemfile b/Gemfile index 53ef2e5..23db5bb 100644 --- a/Gemfile +++ b/Gemfile @@ -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' diff --git a/README.md b/README.md index 185f278..7955a4e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ruby-vernac-parser +# rubyvernac-core ## Installation @@ -11,9 +11,9 @@ Install dependencies: ```ruby - require "ruby-vernac-parser" + require "rubyvernac-core" - parser = RubyVernacParser.new(source_file: , + parser = RubyvernacCore.new(source_file: , language: , keywords_file: ) parser.execute #Execute the parsed script diff --git a/keyword_parser.rb b/keyword_parser.rb index b62e2ad..0678f20 100644 --- a/keyword_parser.rb +++ b/keyword_parser.rb @@ -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], diff --git a/lib/ruby-vernac-parser.rb b/lib/rubyvernac-core.rb similarity index 98% rename from lib/ruby-vernac-parser.rb rename to lib/rubyvernac-core.rb index 0dafff9..6cf1ec7 100644 --- a/lib/ruby-vernac-parser.rb +++ b/lib/rubyvernac-core.rb @@ -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 diff --git a/lib/rubyvernac/generators/template_generator.rb b/lib/rubyvernac/generators/template_generator.rb index fab7c14..23afcf9 100644 --- a/lib/rubyvernac/generators/template_generator.rb +++ b/lib/rubyvernac/generators/template_generator.rb @@ -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. diff --git a/lib/templates/Gemfile b/lib/templates/Gemfile index 85d3903..a059e17 100644 --- a/lib/templates/Gemfile +++ b/lib/templates/Gemfile @@ -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" diff --git a/lib/templates/bin/ruby___lang__.txt b/lib/templates/bin/ruby___lang__.txt index 4375b96..6d7a15d 100644 --- a/lib/templates/bin/ruby___lang__.txt +++ b/lib/templates/bin/ruby___lang__.txt @@ -4,7 +4,7 @@ require "bundler" require "bundler/setup" -require "ruby-vernac-parser" +require "rubyvernac-core" if ARGV.size < 1 puts "Provide a script file" @@ -12,7 +12,7 @@ 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 ) diff --git a/lib/templates/lib/rubyvernac-__lang__.rb b/lib/templates/lib/rubyvernac-__lang__.rb index 1f3994b..a527e09 100644 --- a/lib/templates/lib/rubyvernac-__lang__.rb +++ b/lib/templates/lib/rubyvernac-__lang__.rb @@ -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') diff --git a/ruby-vernac-parser.gemspec b/rubyvernac-core.gemspec similarity index 86% rename from ruby-vernac-parser.gemspec rename to rubyvernac-core.gemspec index 711fbcd..b55cb38 100644 --- a/ruby-vernac-parser.gemspec +++ b/rubyvernac-core.gemspec @@ -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. diff --git a/spec/ruby_vernac_parser_spec.rb b/spec/rubyvernac_core_spec.rb similarity index 85% rename from spec/ruby_vernac_parser_spec.rb rename to spec/rubyvernac_core_spec.rb index e66a14f..3e82064 100644 --- a/spec/ruby_vernac_parser_spec.rb +++ b/spec/rubyvernac_core_spec.rb @@ -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' ) @@ -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