Module: Jarbs::ManifestHelpers
- Included in:
- FunctionGenerator, ProjectGenerator
- Defined in:
- lib/jarbs/manifest_helpers.rb
Instance Method Summary collapse
- #install_fixture(fixture_name, path) ⇒ Object
- #repo_url ⇒ Object
- #whoami ⇒ Object
- #write_package(manifest, path) ⇒ Object
Instance Method Details
#install_fixture(fixture_name, path) ⇒ Object
4 5 6 |
# File 'lib/jarbs/manifest_helpers.rb', line 4 def install_fixture(fixture_name, path) FileUtils.cp File.join(File.dirname(__FILE__), 'fixtures', fixture_name), path end |
#repo_url ⇒ Object
18 19 20 |
# File 'lib/jarbs/manifest_helpers.rb', line 18 def repo_url @repo_url ||= `git config --get remote.origin.url`.chomp end |
#whoami ⇒ Object
14 15 16 |
# File 'lib/jarbs/manifest_helpers.rb', line 14 def whoami @whoami ||= `whoami`.chomp end |
#write_package(manifest, path) ⇒ Object
8 9 10 11 12 |
# File 'lib/jarbs/manifest_helpers.rb', line 8 def write_package(manifest, path) File.open(File.join(path, 'package.json'), 'w') do |f| f.write JSON.pretty_generate(manifest) end end |