mortar 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mortar/helpers.rb +16 -5
- data/lib/mortar/version.rb +1 -1
- metadata +16 -31
data/lib/mortar/helpers.rb
CHANGED
@@ -19,7 +19,7 @@
|
|
19
19
|
|
20
20
|
require 'fileutils'
|
21
21
|
require "vendor/mortar/okjson"
|
22
|
-
require
|
22
|
+
require 'open-uri'
|
23
23
|
|
24
24
|
module Mortar
|
25
25
|
module Helpers
|
@@ -46,10 +46,21 @@ module Mortar
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def download_to_file(url, path, mkdir_p=true)
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
49
|
+
content_length = 0
|
50
|
+
|
51
|
+
set_content_length = lambda do |l|
|
52
|
+
content_length = l
|
53
|
+
end
|
54
|
+
set_progress = lambda do |p|
|
55
|
+
redisplay("Downloading #{path}: #{p.to_i} of #{content_length.to_i}")
|
56
|
+
end
|
57
|
+
|
58
|
+
open(url,
|
59
|
+
:content_length_proc => set_content_length,
|
60
|
+
:progress_proc => set_progress) do |f|
|
61
|
+
write_to_file(f.read, path, mkdir_p)
|
62
|
+
end
|
63
|
+
|
53
64
|
end
|
54
65
|
|
55
66
|
def display(msg="", new_line=true)
|
data/lib/mortar/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mortar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 1
|
10
|
+
version: 0.5.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Mortar Data
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-01-
|
18
|
+
date: 2013-01-23 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: mortar-api-ruby
|
@@ -63,25 +63,10 @@ dependencies:
|
|
63
63
|
version: "2.1"
|
64
64
|
type: :runtime
|
65
65
|
version_requirements: *id003
|
66
|
-
- !ruby/object:Gem::Dependency
|
67
|
-
name: curb
|
68
|
-
prerelease: false
|
69
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
70
|
-
none: false
|
71
|
-
requirements:
|
72
|
-
- - ~>
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
hash: 27
|
75
|
-
segments:
|
76
|
-
- 0
|
77
|
-
- 8
|
78
|
-
version: "0.8"
|
79
|
-
type: :runtime
|
80
|
-
version_requirements: *id004
|
81
66
|
- !ruby/object:Gem::Dependency
|
82
67
|
name: excon
|
83
68
|
prerelease: false
|
84
|
-
requirement: &
|
69
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
85
70
|
none: false
|
86
71
|
requirements:
|
87
72
|
- - ~>
|
@@ -92,11 +77,11 @@ dependencies:
|
|
92
77
|
- 15
|
93
78
|
version: "0.15"
|
94
79
|
type: :development
|
95
|
-
version_requirements: *
|
80
|
+
version_requirements: *id004
|
96
81
|
- !ruby/object:Gem::Dependency
|
97
82
|
name: fakefs
|
98
83
|
prerelease: false
|
99
|
-
requirement: &
|
84
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
100
85
|
none: false
|
101
86
|
requirements:
|
102
87
|
- - ">="
|
@@ -106,11 +91,11 @@ dependencies:
|
|
106
91
|
- 0
|
107
92
|
version: "0"
|
108
93
|
type: :development
|
109
|
-
version_requirements: *
|
94
|
+
version_requirements: *id005
|
110
95
|
- !ruby/object:Gem::Dependency
|
111
96
|
name: gem-release
|
112
97
|
prerelease: false
|
113
|
-
requirement: &
|
98
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
114
99
|
none: false
|
115
100
|
requirements:
|
116
101
|
- - ">="
|
@@ -120,11 +105,11 @@ dependencies:
|
|
120
105
|
- 0
|
121
106
|
version: "0"
|
122
107
|
type: :development
|
123
|
-
version_requirements: *
|
108
|
+
version_requirements: *id006
|
124
109
|
- !ruby/object:Gem::Dependency
|
125
110
|
name: rake
|
126
111
|
prerelease: false
|
127
|
-
requirement: &
|
112
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
128
113
|
none: false
|
129
114
|
requirements:
|
130
115
|
- - ">="
|
@@ -134,11 +119,11 @@ dependencies:
|
|
134
119
|
- 0
|
135
120
|
version: "0"
|
136
121
|
type: :development
|
137
|
-
version_requirements: *
|
122
|
+
version_requirements: *id007
|
138
123
|
- !ruby/object:Gem::Dependency
|
139
124
|
name: rr
|
140
125
|
prerelease: false
|
141
|
-
requirement: &
|
126
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
142
127
|
none: false
|
143
128
|
requirements:
|
144
129
|
- - ">="
|
@@ -148,11 +133,11 @@ dependencies:
|
|
148
133
|
- 0
|
149
134
|
version: "0"
|
150
135
|
type: :development
|
151
|
-
version_requirements: *
|
136
|
+
version_requirements: *id008
|
152
137
|
- !ruby/object:Gem::Dependency
|
153
138
|
name: rspec
|
154
139
|
prerelease: false
|
155
|
-
requirement: &
|
140
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
156
141
|
none: false
|
157
142
|
requirements:
|
158
143
|
- - ">="
|
@@ -162,7 +147,7 @@ dependencies:
|
|
162
147
|
- 0
|
163
148
|
version: "0"
|
164
149
|
type: :development
|
165
|
-
version_requirements: *
|
150
|
+
version_requirements: *id009
|
166
151
|
description: Client library and command-line tool to interact with the Mortar service.
|
167
152
|
email: support@mortardata.com
|
168
153
|
executables:
|