Class: Enginizer::Extension
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Enginizer::Extension
- Includes:
- Thor::Actions
- Defined in:
- lib/enginizer/extension.rb
Class Method Summary collapse
-
.source_root ⇒ Object
Scoping for the files.
Instance Method Summary collapse
- #author ⇒ Object
- #bundler ⇒ Object
- #configure_dependencies ⇒ Object
-
#copy_extension ⇒ Object
Build the extension.
- #email ⇒ Object
- #extension_name ⇒ Object
- #git ⇒ Object
- #namespace ⇒ Object
- #namespaced_name ⇒ Object
- #rvm ⇒ Object
Class Method Details
.source_root ⇒ Object
Scoping for the files
43 44 45 |
# File 'lib/enginizer/extension.rb', line 43 def self.source_root File.("../templates", __FILE__) end |
Instance Method Details
#author ⇒ Object
59 60 61 |
# File 'lib/enginizer/extension.rb', line 59 def `git config user.name`.chomp end |
#bundler ⇒ Object
30 31 32 33 34 |
# File 'lib/enginizer/extension.rb', line 30 def bundler if .bundler? run "cd #{extension_path} && bundle install" end end |
#configure_dependencies ⇒ Object
11 12 13 14 |
# File 'lib/enginizer/extension.rb', line 11 def configure_dependencies extension_path extension_name end |
#copy_extension ⇒ Object
Build the extension
17 18 19 |
# File 'lib/enginizer/extension.rb', line 17 def copy_extension directory "%namespaced_name%", extension_path end |
#email ⇒ Object
63 64 65 |
# File 'lib/enginizer/extension.rb', line 63 def email `git config user.email`.chomp end |
#extension_name ⇒ Object
55 56 57 |
# File 'lib/enginizer/extension.rb', line 55 def extension_name @extension_name ||= @namespaced_name.gsub("#{.namespace}_", "") end |
#git ⇒ Object
36 37 38 39 40 |
# File 'lib/enginizer/extension.rb', line 36 def git if .git? run "cd #{extension_path} && git init && git add ." end end |
#namespace ⇒ Object
51 52 53 |
# File 'lib/enginizer/extension.rb', line 51 def namespace .namespace end |
#namespaced_name ⇒ Object
47 48 49 |
# File 'lib/enginizer/extension.rb', line 47 def namespaced_name @namespaced_name end |
#rvm ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/enginizer/extension.rb', line 21 def rvm if .rvm? ENV["rvm_trust_rvmrcs_flag"]="1" RVM.use_from_path! extension_path else run "rm #{extension_path}/.rvmrc" end end |