xspree 0.1.2 → 0.2.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.
data/Rakefile CHANGED
@@ -3,7 +3,7 @@ require 'rake'
3
3
  require 'cucumber/rake/task'
4
4
  require 'date'
5
5
 
6
- XSPREE_GEM_VERSION = '0.1.2'
6
+ XSPREE_GEM_VERSION = '0.2.0'
7
7
 
8
8
  #############################################################################
9
9
  #
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__)} create new_project_name"
9
+ "Usage: #{File.basename(__FILE__)} new new_project_name"
10
10
  end
11
11
 
12
12
  case ARGV[0]
13
- when 'create', '--create'
13
+ when 'new', '--create'
14
14
  begin
15
15
  XSpree::Create.run!(ARGV[1])
16
16
  rescue XSpree::InvalidInput => e
@@ -2,8 +2,7 @@
2
2
  # =============
3
3
  # by Alessio Rocco
4
4
 
5
- require 'net/http'
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
- uri = URI.parse(uri_string)
37
- http = Net::HTTP.new(uri.host, uri.port)
38
- http.use_ssl = true if uri_string =~ /^https/
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"
@@ -4,7 +4,7 @@ Gem::Specification.new do |s|
4
4
  s.rubygems_version = '1.6.2'
5
5
 
6
6
  s.name = 'xspree'
7
- s.version = '0.1.2'
7
+ s.version = '0.2.0'
8
8
  s.date = '2011-06-21'
9
9
 
10
10
  s.summary = "Generate a Spree app using Alessio Rocco's best practices."
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: xspree
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.2
5
+ version: 0.2.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - thoughtbot