Class: ExtJS::XTheme::Command::Theme
- Inherits:
-
Base
- Object
- Base
- ExtJS::XTheme::Command::Theme
show all
- Defined in:
- lib/extjs-xtheme/commands/theme.rb
Instance Attribute Summary
Attributes inherited from Base
#args, #config
Instance Method Summary
collapse
Methods inherited from Base
#ask, #display, #error, #escape, #extract_app, #extract_app_in_dir, #extract_option, #heroku, #initialize, #shell
Instance Method Details
#create ⇒ Object
35
36
37
38
39
40
41
42
43
|
# File 'lib/extjs-xtheme/commands/theme.rb', line 35
def create
name = args.shift.downcase.strip rescue nil
if !name
return display "Usage: xtheme create <name>"
end
ExtJS::XTheme::Generator.create(name, @config[:ext_dir], @config[:theme_dir])
display "Created #{name}"
end
|
#destroy ⇒ Object
45
46
47
|
# File 'lib/extjs-xtheme/commands/theme.rb', line 45
def destroy
display "Not implemented"
end
|
#init ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/extjs-xtheme/commands/theme.rb', line 6
def init
unless args.length == 2
display "Usage: xtheme init <path/to/ext> <path/to/stylesheets>"
display " - Eg: xtheme init public/javascripts/ext-3.1.0 public/stylesheets"
return
end
unless File.directory?(args[0])
return display "Error: invalid path/to/ext #{args[0]}"
end
unless File.directory?(args[1])
return display "Error: invalid path/to/stylesheets #{args[1]}"
end
display "Initializing xtheme configuration file .xthemeconfig"
File.open(".xthemeconfig", "w+") {|f|
f << {
:ext_dir => args[0],
:theme_dir => "#{args[1]}/sass"
}.to_yaml
}
end
|
#list ⇒ Object
31
32
33
|
# File 'lib/extjs-xtheme/commands/theme.rb', line 31
def list
display "Not implemented"
end
|