Module: RocketApi::Library::GemRepoPlainText
- Included in:
- RocketCommands
- Defined in:
- lib/rocket_api/library/gem_repo_plain_text.rb
Instance Method Summary collapse
- #gemfile_text ⇒ Object
- #gitignore_text ⇒ Object
- #plain_gem_test_version_text(name, module_name) ⇒ Object
- #plain_gemspec_text(name, module_name) ⇒ Object
- #plain_version_text(module_name) ⇒ Object
Instance Method Details
#gemfile_text ⇒ Object
49 50 51 52 53 |
# File 'lib/rocket_api/library/gem_repo_plain_text.rb', line 49 def gemfile_text ["source 'https://rubygems.org/'", "ruby 'RUBY_VERSION'", "gemspec"].join("\n") end |
#gitignore_text ⇒ Object
4 5 6 |
# File 'lib/rocket_api/library/gem_repo_plain_text.rb', line 4 def gitignore_text ".idea/\nGemfile.lock\n*.gem".freeze end |
#plain_gem_test_version_text(name, module_name) ⇒ Object
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/rocket_api/library/gem_repo_plain_text.rb', line 38 def plain_gem_test_version_text(name, module_name) ["require 'minitest/autorun'", "require '#{name}/version'\n", "class TestVersion < Minitest::Test", "\tinclude #{module_name}\n", "\tdef test_ping", "\t\tassert_equal(\"0.0.1\", #{module_name}::VERSION)", "\tend", "end"].join("\n") end |
#plain_gemspec_text(name, module_name) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/rocket_api/library/gem_repo_plain_text.rb', line 12 def plain_gemspec_text(name, module_name) ["lib = File.expand_path(\"lib\", __dir__)", "$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n", "require 'English'", "require '#{name}/version'\n", "Gem::Specification.new do |s|", "\ts.specification_version = 2 if s.respond_to? :specification_version=", "\tif s.respond_to? :required_rubygems_version=", "\t\ts.required_rubygems_version = Gem::Requirement.new('>= 0')", "\tend", "\ts.rubygems_version = 'RUBY_VERSION'", "\ts.required_ruby_version = 'RUBY_VERSION'", "\ts.name = '#{name}'", "\ts.version = #{module_name}::VERSION", "\ts.executables << '#{name}'", "\ts.summary = 'PUT_SUMMARY'", "\ts.description = 'PUT_DESCRIPTION'", "\ts.authors = ['AUTHOR']", "\ts.email = 'AUTHOR_MAIL'", "\ts.homepage = 'https://github.com/...'", "\ts.files = `git ls-files`.split($RS)", "\ts.add_dependency \"rubocop\"", "\ts.add_dependency \"rubocop-rake\"", "end"].join("\n") end |
#plain_version_text(module_name) ⇒ Object
8 9 10 |
# File 'lib/rocket_api/library/gem_repo_plain_text.rb', line 8 def plain_version_text(module_name) "module #{module_name}\n\tVERSION = \"0.0.1\".freeze\nend" end |