Class: Noumenon::Cli

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/noumenon/cli.rb

Instance Method Summary collapse

Instance Method Details

#application(name) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/noumenon/cli.rb', line 26

def application(name)
  @name = name
  
  say_status :application, name
  
  empty_directory name

  inside name do
    [ "lib", "lib/noumenon", "lib/noumenon", "lib/noumenon/#{name}", "templates", "assets", "features", "features/support", "features/step_definitions" ].each do |dir|
      empty_directory dir
    end

    create_file("Gemfile") { "gemspec" }
  end
   
  template "application/application.gemspec", "#{name}/noumenon-#{name}.gemspec"
  template "application/application.rb", "#{name}/lib/noumenon/#{name}/application.rb"
  template "application/version.rb", "#{name}/lib/noumenon/#{name}/version.rb"
  template "application/load.rb", "#{name}/lib/noumenon/#{name}.rb"

  invoke :application_features, name
end

#application_features(name) ⇒ Object



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/noumenon/cli.rb', line 50

def application_features(name)
  @name = name
  
  inside name do
    [ "features", "features/support", "features/step_definitions" ].each do |dir|
      empty_directory dir
    end
  end
  
  template "application/Rakefile", "#{name}/Rakefile"
  template "application/features/example.feature", "#{name}/features/example.feature"
  template "application/features/support/env.rb", "#{name}/features/support/env.rb"
  
  path = "#{name}/features/support"
  invoke :theme, [ File.join(path, "theme") ]
  invoke :repository, [ File.join(path, "content") ]
end

#repository(path) ⇒ Object



21
22
23
# File 'lib/noumenon/cli.rb', line 21

def repository(path)
  generate :repository, path
end

#site(path) ⇒ Object



9
10
11
12
13
# File 'lib/noumenon/cli.rb', line 9

def site(path)
  generate :site, path
  invoke :theme, [ File.join(path, "theme") ]
  invoke :repository, [ File.join(path, "content") ]
end

#theme(path) ⇒ Object



16
17
18
# File 'lib/noumenon/cli.rb', line 16

def theme(path)
  generate :theme, path
end