Module: Arethusa::CLI::Helpers::DirectoriesAndFiles

Defined in:
lib/arethusa/cli/helpers/directories_and_files.rb

Instance Method Summary collapse

Instance Method Details

#conf_dir(file = '') ⇒ Object



36
37
38
# File 'lib/arethusa/cli/helpers/directories_and_files.rb', line 36

def conf_dir(file = '')
  File.join(destination_root, 'app/static', 'configs', file)
end

#create_bowerObject



72
73
74
# File 'lib/arethusa/cli/helpers/directories_and_files.rb', line 72

def create_bower
  template(template_path('bower'), 'bower.json')
end

#create_conf_fileObject



88
89
90
# File 'lib/arethusa/cli/helpers/directories_and_files.rb', line 88

def create_conf_file
  template(template_path('conf'), conf_dir('staging.json'))
end

#create_gitignoreObject



60
61
62
# File 'lib/arethusa/cli/helpers/directories_and_files.rb', line 60

def create_gitignore
  template(template_path('gitignore'), '.gitignore')
end

#create_gruntfileObject



76
77
78
# File 'lib/arethusa/cli/helpers/directories_and_files.rb', line 76

def create_gruntfile
  template(template_path('gruntfile'), 'Gruntfile.js')
end

#create_html_templateObject



52
53
54
# File 'lib/arethusa/cli/helpers/directories_and_files.rb', line 52

def create_html_template
  template(template_path('html_template'), html_template_file)
end

#create_index_fileObject



84
85
86
# File 'lib/arethusa/cli/helpers/directories_and_files.rb', line 84

def create_index_file
  template(template_path('index'), "app/index.html")
end

#create_jshintrcObject



64
65
66
# File 'lib/arethusa/cli/helpers/directories_and_files.rb', line 64

def create_jshintrc
  template(template_path('jshintrc'), '.jshintrc')
end

#create_moduleObject



44
45
46
# File 'lib/arethusa/cli/helpers/directories_and_files.rb', line 44

def create_module
  template(template_path('module'), js_dir("#{namespaced_name}.js"))
end

#create_packageObject



68
69
70
# File 'lib/arethusa/cli/helpers/directories_and_files.rb', line 68

def create_package
  template(template_path('package'), 'package.json')
end

#create_retrieverObject



92
93
94
# File 'lib/arethusa/cli/helpers/directories_and_files.rb', line 92

def create_retriever
  template(template_path('retriever'), js_dir(File.join(mod, "#{name}.js")))
end

#create_retriever_specObject



96
97
98
# File 'lib/arethusa/cli/helpers/directories_and_files.rb', line 96

def create_retriever_spec
  template(template_path('retriever_spec'), spec_dir("#{name}_spec.js"))
end

#create_scssObject



80
81
82
# File 'lib/arethusa/cli/helpers/directories_and_files.rb', line 80

def create_scss
  template(template_path('scss'), css_dir("#{namespaced_name}.scss"))
end

#create_serviceObject



48
49
50
# File 'lib/arethusa/cli/helpers/directories_and_files.rb', line 48

def create_service
  template(template_path('service'), plugin_dir("#{name}.js"))
end

#create_specObject



56
57
58
# File 'lib/arethusa/cli/helpers/directories_and_files.rb', line 56

def create_spec
  template(template_path('plugin_spec'), spec_dir("#{name}_spec.js"))
end

#css_dir(file = '') ⇒ Object



32
33
34
# File 'lib/arethusa/cli/helpers/directories_and_files.rb', line 32

def css_dir(file = '')
  File.join(destination_root, 'app/css', file)
end

#dist_dir(file = '') ⇒ Object



40
41
42
# File 'lib/arethusa/cli/helpers/directories_and_files.rb', line 40

def dist_dir(file = '')
  File.join(destination_root, 'dist', file)
end

#html_template_fileObject



16
17
18
# File 'lib/arethusa/cli/helpers/directories_and_files.rb', line 16

def html_template_file
  template_dir("#{name}.html")
end

#js_dir(file = '') ⇒ Object



20
21
22
# File 'lib/arethusa/cli/helpers/directories_and_files.rb', line 20

def js_dir(file = '')
  File.join(destination_root, 'app/js', file)
end

#plugin_dir(file = '') ⇒ Object



8
9
10
# File 'lib/arethusa/cli/helpers/directories_and_files.rb', line 8

def plugin_dir(file = '')
  File.join(js_dir, namespaced_name, file)
end

#spec_dir(file = '') ⇒ Object



28
29
30
# File 'lib/arethusa/cli/helpers/directories_and_files.rb', line 28

def spec_dir(file = '')
  File.join(destination_root, 'spec', mod || namespaced_name, file)
end

#temp_dirObject



24
25
26
# File 'lib/arethusa/cli/helpers/directories_and_files.rb', line 24

def temp_dir
  File.join(destination_root, 'app/templates')
end

#template_dir(file = '') ⇒ Object



12
13
14
# File 'lib/arethusa/cli/helpers/directories_and_files.rb', line 12

def template_dir(file = '')
  File.join(temp_dir, namespaced_name, file)
end

#template_path(name) ⇒ Object



4
5
6
# File 'lib/arethusa/cli/helpers/directories_and_files.rb', line 4

def template_path(name)
  File.join(File.expand_path('../../templates/', __FILE__), name)
end