Class: Transcriptic::ProjectGenerator
- Inherits:
-
BaseGenerator
- Object
- Thor::Group
- BaseGenerator
- Transcriptic::ProjectGenerator
- Defined in:
- lib/transcriptic/project_generator.rb
Instance Method Summary collapse
- #author ⇒ Object
- #author? ⇒ Boolean
- #autoprotocol_version ⇒ Object
- #copyright_year ⇒ Object
- #description ⇒ Object
- #email ⇒ Object
- #generate ⇒ Object
- #group ⇒ Object
- #update_build_version(labfile) ⇒ Object
- #version ⇒ Object
Methods inherited from BaseGenerator
Instance Method Details
#author ⇒ Object
61 62 63 |
# File 'lib/transcriptic/project_generator.rb', line 61 def [:author] end |
#author? ⇒ Boolean
69 70 71 |
# File 'lib/transcriptic/project_generator.rb', line 69 def not ([:author] == "John Appleseed") end |
#autoprotocol_version ⇒ Object
45 46 47 |
# File 'lib/transcriptic/project_generator.rb', line 45 def autoprotocol_version Transcriptic::AUTOPROTOCOL_VERSION end |
#copyright_year ⇒ Object
73 74 75 |
# File 'lib/transcriptic/project_generator.rb', line 73 def copyright_year Time.now.year end |
#description ⇒ Object
49 50 51 |
# File 'lib/transcriptic/project_generator.rb', line 49 def description [:description] end |
#email ⇒ Object
65 66 67 |
# File 'lib/transcriptic/project_generator.rb', line 65 def email [:email] end |
#generate ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/transcriptic/project_generator.rb', line 23 def generate empty_directory target.join('app') empty_directory target.join('project') version template 'app/Main.erb', target.join('app/Main.scala') template 'project/Build.erb', target.join('project/Build.scala') copy_file 'project/build.properties', target.join('project/build.properties') copy_file 'project/plugins.sbt', target.join('project/plugins.sbt') copy_file 'README.md', target.join('README.md') template 'LICENSE.erb', target.join('LICENSE') template 'Labfile.erb', target.join('Labfile') Transcriptic::DependenciesGenerator.new([File.join(Dir.pwd, name), []], ).invoke_all end |
#group ⇒ Object
53 54 55 |
# File 'lib/transcriptic/project_generator.rb', line 53 def group [:group] end |
#update_build_version(labfile) ⇒ Object
40 41 42 43 |
# File 'lib/transcriptic/project_generator.rb', line 40 def update_build_version(labfile) @version = labfile.[:version] template 'project/Build.erb', target.join('project/Build.scala'), force: true end |
#version ⇒ Object
57 58 59 |
# File 'lib/transcriptic/project_generator.rb', line 57 def version @version = [:version] end |