volt 0.9.5.pre5 → 0.9.5.pre6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/volt/cli.rb +27 -22
- data/lib/volt/cli/asset_compile.rb +1 -0
- data/lib/volt/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e582dab04f540400c74bab267d28e0e138977b0f
|
4
|
+
data.tar.gz: 1fd96c3672b66a1ecb3610bca02876c5bf62507d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58642fa49f534975037d7389a4ebb8c9de0e66cb65370306e007afc27bd02800aa747be8fca53aff9c8492e119cf944e13680d45942c1bd58d2a90fcedd25860
|
7
|
+
data.tar.gz: 59c6d2309af1bf94dcf05a8622b7fbfb823d9d371cef696efd0724e6f175437a012d0e3cc6a5f1b633500d88593e55d145db8203789378258b142a71bfb06a43
|
data/lib/volt/cli.rb
CHANGED
@@ -50,6 +50,7 @@ module Volt
|
|
50
50
|
method_option :bind, type: :string, aliases: '-b', banner: 'the ip the server should bind to'
|
51
51
|
|
52
52
|
def server
|
53
|
+
move_to_root
|
53
54
|
if ENV['PROFILE_BOOT']
|
54
55
|
begin
|
55
56
|
require 'ruby-prof'
|
@@ -102,6 +103,7 @@ module Volt
|
|
102
103
|
method_option :file_path, type: :string
|
103
104
|
def runner(file_path)
|
104
105
|
ENV['SERVER'] = 'true'
|
106
|
+
move_to_root
|
105
107
|
require 'volt/cli/runner'
|
106
108
|
|
107
109
|
Volt::CLI::Runner.run_file(file_path)
|
@@ -111,6 +113,7 @@ module Volt
|
|
111
113
|
|
112
114
|
def drop_collection(collection)
|
113
115
|
ENV['SERVER'] = 'true'
|
116
|
+
move_to_root
|
114
117
|
require 'volt/boot'
|
115
118
|
|
116
119
|
Volt.boot(Dir.pwd)
|
@@ -122,6 +125,30 @@ module Volt
|
|
122
125
|
say("Collection #{collection} dropped", :green) if drop == true
|
123
126
|
end
|
124
127
|
|
128
|
+
def move_to_root
|
129
|
+
unless Gem.win_platform?
|
130
|
+
# Change CWD to the root of the volt project
|
131
|
+
pwd = Dir.pwd
|
132
|
+
changed = false
|
133
|
+
loop do
|
134
|
+
if File.exists?(pwd + '/Gemfile')
|
135
|
+
Dir.chdir(pwd) if changed
|
136
|
+
break
|
137
|
+
else
|
138
|
+
changed = true
|
139
|
+
|
140
|
+
# Move up a directory and try again
|
141
|
+
pwd = pwd.gsub(/\/[^\/]+$/, '')
|
142
|
+
|
143
|
+
if pwd == ''
|
144
|
+
puts "You are not currently in a volt project directory"
|
145
|
+
exit 1
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
125
152
|
def self.source_root
|
126
153
|
File.expand_path(File.join(File.dirname(__FILE__), '../../templates'))
|
127
154
|
end
|
@@ -131,27 +158,5 @@ end
|
|
131
158
|
# Add in more features
|
132
159
|
require 'volt/cli/asset_compile'
|
133
160
|
|
134
|
-
unless Gem.win_platform?
|
135
|
-
# Change CWD to the root of the volt project
|
136
|
-
pwd = Dir.pwd
|
137
|
-
changed = false
|
138
|
-
loop do
|
139
|
-
if File.exists?(pwd + '/Gemfile')
|
140
|
-
Dir.chdir(pwd) if changed
|
141
|
-
break
|
142
|
-
else
|
143
|
-
changed = true
|
144
|
-
|
145
|
-
# Move up a directory and try again
|
146
|
-
pwd = pwd.gsub(/\/[^\/]+$/, '')
|
147
|
-
|
148
|
-
if pwd == ''
|
149
|
-
puts "You are not currently in a volt project directory"
|
150
|
-
exit 1
|
151
|
-
end
|
152
|
-
end
|
153
|
-
end
|
154
|
-
end
|
155
|
-
|
156
161
|
puts "Volt #{Volt::Version::STRING}"
|
157
162
|
Volt::CLI.start(ARGV)
|
data/lib/volt/version.rb
CHANGED