rupi 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/bin/rupi +17 -11
  2. data/lib/rupi/generator.rb +22 -0
  3. data/lib/rupi/version.rb +1 -1
  4. metadata +20 -3
data/bin/rupi CHANGED
@@ -1,19 +1,25 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- if ENV["USER"] != 'root'
4
- exec("rvmsudo #{ENV['_']} #{ARGV.join(' ')}")
5
- end
6
-
7
3
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..' , 'lib'))
8
4
 
9
- require 'rubygems'
10
- require 'rupi'
5
+ if ['new', 'help'].include?(ARGV[0])
6
+ require 'rupi/generator'
7
+ Rupi::Generator.start
8
+ else
9
+ if ENV['USER'] != 'root'
10
+ exec("rvmsudo #{ENV['_']} #{ARGV.join(' ')}")
11
+ end
12
+
13
+
14
+ require 'rubygems'
15
+ require 'rupi'
11
16
 
12
- include Rupi
17
+ include Rupi
13
18
 
14
- load ARGV[0]
19
+ load ARGV[0]
15
20
 
16
- if Rupi::Pin.watching?
17
- trap("SIGINT") { Rupi::Pin.stop_watching }
18
- Rupi::Pin.join_watch_thread
21
+ if Rupi::Pin.watching?
22
+ trap('SIGINT') { Rupi::Pin.stop_watching }
23
+ Rupi::Pin.join_watch_thread
24
+ end
19
25
  end
@@ -0,0 +1,22 @@
1
+ require 'thor'
2
+ require 'pathname'
3
+
4
+ module Rupi
5
+ class Generator < Thor
6
+ include Thor::Actions
7
+
8
+ attr_reader :name
9
+
10
+ desc 'new NAME', 'Creates a new rupi application'
11
+ def new(name)
12
+ @name = name
13
+ copy_file 'Gemfile', "#{name}/Gemfile"
14
+ template 'Capfile.erb', "#{name}/Capfile"
15
+ copy_file 'app.rb', "#{name}/app.rb"
16
+ end
17
+
18
+ def self.source_root
19
+ Pathname.new(__FILE__) + '../../../templates'
20
+ end
21
+ end
22
+ end
data/lib/rupi/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Rupi
2
- VERSION = '0.3.1'
2
+ VERSION = '0.4.0'
3
3
  RUBY_VERSION = 'ruby-1.9.3-p194'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rupi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -43,6 +43,22 @@ dependencies:
43
43
  - - ! '>='
44
44
  - !ruby/object:Gem::Version
45
45
  version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: thor
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
46
62
  - !ruby/object:Gem::Dependency
47
63
  name: rake
48
64
  requirement: !ruby/object:Gem::Requirement
@@ -72,6 +88,7 @@ files:
72
88
  - bin/rupi_service
73
89
  - lib/rupi/camera.rb
74
90
  - lib/rupi/capistrano.rb
91
+ - lib/rupi/generator.rb
75
92
  - lib/rupi/pin.rb
76
93
  - lib/rupi/sprinkle.rb
77
94
  - lib/rupi/version.rb
@@ -91,7 +108,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
91
108
  version: '0'
92
109
  segments:
93
110
  - 0
94
- hash: -3886384276610415330
111
+ hash: -446998733732974760
95
112
  required_rubygems_version: !ruby/object:Gem::Requirement
96
113
  none: false
97
114
  requirements:
@@ -100,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
117
  version: '0'
101
118
  segments:
102
119
  - 0
103
- hash: -3886384276610415330
120
+ hash: -446998733732974760
104
121
  requirements: []
105
122
  rubyforge_project:
106
123
  rubygems_version: 1.8.24