Module: RocketApi::Library::GemRepoPlainText

Included in:
RocketCommands
Defined in:
lib/rocket_api/library/gem_repo_plain_text.rb

Instance Method Summary collapse

Instance Method Details

#gitignore_textObject



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_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
# 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)",
   "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