xspree 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/bin/xspree +2 -2
- data/template/xspree.rb +4 -9
- data/xspree.gemspec +1 -1
- metadata +1 -1
data/Rakefile
CHANGED
data/bin/xspree
CHANGED
@@ -6,11 +6,11 @@ require File.expand_path(File.dirname(__FILE__) + "/../lib/errors")
|
|
6
6
|
include XSpree::Errors
|
7
7
|
|
8
8
|
def usage
|
9
|
-
"Usage: #{File.basename(__FILE__)}
|
9
|
+
"Usage: #{File.basename(__FILE__)} new new_project_name"
|
10
10
|
end
|
11
11
|
|
12
12
|
case ARGV[0]
|
13
|
-
when '
|
13
|
+
when 'new', '--create'
|
14
14
|
begin
|
15
15
|
XSpree::Create.run!(ARGV[1])
|
16
16
|
rescue XSpree::InvalidInput => e
|
data/template/xspree.rb
CHANGED
@@ -2,8 +2,7 @@
|
|
2
2
|
# =============
|
3
3
|
# by Alessio Rocco
|
4
4
|
|
5
|
-
require '
|
6
|
-
require 'net/https'
|
5
|
+
require 'open-uri'
|
7
6
|
|
8
7
|
template_root = File.expand_path(File.join(File.dirname(__FILE__)))
|
9
8
|
source_paths << File.join(template_root, "files")
|
@@ -33,13 +32,9 @@ def action_mailer_host(rails_env, host)
|
|
33
32
|
end
|
34
33
|
|
35
34
|
def download_file(uri_string, destination)
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
request = Net::HTTP::Get.new(uri.path)
|
40
|
-
contents = http.request(request).body
|
41
|
-
path = File.join(destination_root, destination)
|
42
|
-
File.open(path, "w") { |file| file.write(contents) }
|
35
|
+
write_out = open(destination, "wb")
|
36
|
+
write_out.write(open(uri_string).read)
|
37
|
+
write_out.close
|
43
38
|
end
|
44
39
|
|
45
40
|
say "Getting rid of files we don't use"
|
data/xspree.gemspec
CHANGED