wrench 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -16,12 +16,14 @@ a tool for ruby web development
16
16
  * thor
17
17
  * zip
18
18
 
19
+ *wrench has been tested against ruby 1.9.2-p290*
20
+
19
21
  ## installation
20
22
 
21
23
  ### gem package
22
24
 
23
25
  1. install gem from rubygems
24
- ```gem install wrench-0.0.1.gem```
26
+ ```gem install wrench-0.0.2.gem```
25
27
 
26
28
  ### from source
27
29
 
@@ -32,8 +34,11 @@ a tool for ruby web development
32
34
  3. build the gem
33
35
  ```gem build wrench.gemspec # from the wrench directory```
34
36
  4. install the local gem
35
- ```gem install wrench-0.0.1.gem```
37
+ ```gem install wrench-0.0.2.gem```
38
+
39
+ ## testing
36
40
 
41
+ * wrench has been tested against ruby 1.9.2-p290
37
42
  ## faq
38
43
 
39
44
  1. how do i customize wrench?
data/conf/config.yaml CHANGED
@@ -5,6 +5,8 @@ assets:
5
5
  url: https://github.com/jquery/jquery-ui/archive/master.zip
6
6
  - name: glyphicons
7
7
  url: http://glyphicons.com/files/glyphicons_free.zip
8
+ - name: json2
9
+ url: https://raw.github.com/douglascrockford/JSON-js/master/json2.js
8
10
  directories:
9
11
  - conf
10
12
  - docs
data/lib/wrench/cli.rb CHANGED
@@ -36,6 +36,13 @@ module Wrench
36
36
 
37
37
  end
38
38
 
39
+ desc( "test", "test" )
40
+ def test
41
+
42
+ resource_ext("https://raw.github.com/douglascrockford/JSON-js/master/json2.js")
43
+
44
+ end
45
+
39
46
  no_tasks do
40
47
 
41
48
  def create_directories(name)
@@ -92,6 +99,36 @@ module Wrench
92
99
 
93
100
  def download(url)
94
101
 
102
+ ext = resource_ext(url)
103
+
104
+ if ext == ".zip"
105
+ download_binary(url)
106
+ elsif ext == ".js"
107
+ download_ascii(url)
108
+ else
109
+ puts "Unsupported resource type".red
110
+ end
111
+
112
+ end
113
+
114
+ def download_ascii(url)
115
+
116
+ ascii = open(url)
117
+
118
+ filename = File.basename(url)
119
+
120
+ unless File.exists?("./#{filename}")
121
+
122
+ f = File.open( filename, "w" )
123
+ f.write(ascii.read)
124
+ f.close
125
+
126
+ end
127
+
128
+ end
129
+
130
+ def download_binary(url)
131
+
95
132
  bin = open(url)
96
133
 
97
134
  Zip::ZipFile.open(bin.path) do |z|
@@ -108,6 +145,12 @@ module Wrench
108
145
 
109
146
  end
110
147
 
148
+ def resource_ext(url)
149
+
150
+ return File.extname(url)
151
+
152
+ end
153
+
111
154
  end
112
155
 
113
156
  end
@@ -1,3 +1,3 @@
1
1
  module Wrench
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wrench
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - stephen hu
@@ -13,6 +14,7 @@ dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: colorize
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ~>
18
20
  - !ruby/object:Gem::Version
@@ -20,6 +22,7 @@ dependencies:
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - ~>
25
28
  - !ruby/object:Gem::Version
@@ -27,6 +30,7 @@ dependencies:
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: thor
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - ~>
32
36
  - !ruby/object:Gem::Version
@@ -34,6 +38,7 @@ dependencies:
34
38
  type: :runtime
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
43
  - - ~>
39
44
  - !ruby/object:Gem::Version
@@ -41,6 +46,7 @@ dependencies:
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: zip
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
51
  - - ~>
46
52
  - !ruby/object:Gem::Version
@@ -48,6 +54,7 @@ dependencies:
48
54
  type: :runtime
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
59
  - - ~>
53
60
  - !ruby/object:Gem::Version
@@ -80,25 +87,26 @@ files:
80
87
  homepage: http://github.com/stephenhu/wrench
81
88
  licenses:
82
89
  - MIT
83
- metadata: {}
84
90
  post_install_message:
85
91
  rdoc_options: []
86
92
  require_paths:
87
93
  - lib
88
94
  required_ruby_version: !ruby/object:Gem::Requirement
95
+ none: false
89
96
  requirements:
90
97
  - - ! '>='
91
98
  - !ruby/object:Gem::Version
92
99
  version: '0'
93
100
  required_rubygems_version: !ruby/object:Gem::Requirement
101
+ none: false
94
102
  requirements:
95
103
  - - ! '>='
96
104
  - !ruby/object:Gem::Version
97
105
  version: '0'
98
106
  requirements: []
99
107
  rubyforge_project:
100
- rubygems_version: 2.0.0
108
+ rubygems_version: 1.8.23
101
109
  signing_key:
102
- specification_version: 4
110
+ specification_version: 3
103
111
  summary: command line tool for ruby web development
104
112
  test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: a0cd90f455d01fcab1d20e318a1eab5b87550544
4
- data.tar.gz: 1c8a4a5df83c6a2222d32ec171888ac887c0def4
5
- SHA512:
6
- metadata.gz: e964b7b11baf46a792b4080f57989fba526e16c29b2c19c21ddc6dfa8c7ed4e0b68d6498826a0c42cc13c3020c0f7cc57c0e834a08e8c12ef2bae4ca41439b20
7
- data.tar.gz: 814ffe1c5cf6c5eb71c185b260e8c6631c312dc019a027ad679410a34c56594e337f55748a798443b62ae20c196da62541eaff392e12bb7019f2ee2b99545cc8