Module: RocketApi::Commands::GemsDir

Included in:
RocketCommands
Defined in:
lib/rocket_api/commands/gems_dir.rb

Instance Method Summary collapse

Instance Method Details

#gem_test!(name) ⇒ Object

Parameters:

  • name (String)


26
27
28
29
# File 'lib/rocket_api/commands/gems_dir.rb', line 26

def gem_test!(name)
  file_name = "test/test_version.rb"
  create_single_file(file_name, plain_gem_test_version_text(name, class_name_camel(name)))
end

#gems_main_file!(name) ⇒ Object

Parameters:

  • name (String)


13
14
15
16
17
# File 'lib/rocket_api/commands/gems_dir.rb', line 13

def gems_main_file!(name)
  file_name = "lib/#{name}.rb"
  text = "class #{class_name_camel(name)}; end"
  create_single_file(file_name, text)
end

#gems_version!(name) ⇒ Object

Parameters:

  • name (String)


5
6
7
8
9
10
# File 'lib/rocket_api/commands/gems_dir.rb', line 5

def gems_version!(name)
  dir_name = "lib/#{name}"
  create_dir(dir_name)
  file_name = "#{dir_name}/version.rb"
  create_single_file(file_name, plain_version_text(class_name_camel(name)))
end

#gemspec!(name) ⇒ Object

Parameters:

  • name (String)


20
21
22
23
# File 'lib/rocket_api/commands/gems_dir.rb', line 20

def gemspec!(name)
  file_name = "#{name}.gemspec"
  create_single_file(file_name, plain_gemspec_text(name, class_name_camel(name)))
end

#rubocop_yml!(name) ⇒ Object



31
32
33
34
# File 'lib/rocket_api/commands/gems_dir.rb', line 31

def rubocop_yml!(name)
  file_name = ".rubocop.yml"
  create_single_file(file_name, plain_rubocop_yml_text(name))
end