Class: AmsLayout::Generate
- Inherits:
-
Thor
- Object
- Thor
- AmsLayout::Generate
- Defined in:
- lib/ams_layout/cli/generate.rb
Instance Method Summary collapse
- #all(path) ⇒ Object
- #cls(path, layout_path) ⇒ Object
- #delegate(path, layout_path) ⇒ Object
- #layout(path) ⇒ Object
Instance Method Details
#all(path) ⇒ Object
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/ams_layout/cli/generate.rb', line 105 def all(path) env = AmsLayout.configuration.default_environment env = [:env] if [:env] user, pass = credentials env # Generate layout file client.login(user, pass) client.write_layout path, false client.logout # Generate layout class if [:name] client.layout_class_name = [:name] end client.write_layout_class path, path # Generate delegate class if [:delegate] client.delegate_class_name = [:delegate] end client.write_delegate_class path, path end |
#cls(path, layout_path) ⇒ Object
53 54 55 56 57 58 59 |
# File 'lib/ams_layout/cli/generate.rb', line 53 def cls(path, layout_path) if [:name] client.layout_class_name = [:name] end client.write_layout_class path, layout_path end |
#delegate(path, layout_path) ⇒ Object
78 79 80 81 82 83 84 |
# File 'lib/ams_layout/cli/generate.rb', line 78 def delegate(path, layout_path) if [:delegate] client.delegate_class_name = [:delegate] end client.write_delegate_class path, layout_path end |
#layout(path) ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/ams_layout/cli/generate.rb', line 26 def layout(path) env = AmsLayout.configuration.default_environment env = [:env] if [:env] user, pass = credentials env client.login(user, pass) client.write_layout path, false client.logout end |