strobe 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
data/lib/strobe/cli.rb CHANGED
@@ -36,7 +36,13 @@ module Strobe
36
36
  end
37
37
  end
38
38
  rescue NotifiableError => e
39
- raise if $__ARGV.include?('--backtrace')
39
+ if $__ARGV.include?('--backtrace')
40
+ require 'pp'
41
+ puts "=== ERROR DATA ==="
42
+ pp e.data
43
+ puts "\n"
44
+ raise
45
+ end
40
46
  STDERR.puts "[ERROR] #{e.message}"
41
47
  ExceptionNotifier.notify(e, :action => args.join(" "))
42
48
  abort
@@ -3,6 +3,15 @@ require 'net/http'
3
3
  require 'net/https'
4
4
 
5
5
  module Strobe
6
+
7
+ class JSONParseError < NotifiableError
8
+ def initialize(error = nil, body = nil)
9
+ set_backtrace(error.backtrace)
10
+ data = { :raw_body => body, :original_message => error.message }
11
+ super("Error parsing JSON from server", data)
12
+ end
13
+ end
14
+
6
15
  class Connection
7
16
  def self.host_and_port(uri)
8
17
  uri = "http://#{uri}" unless uri =~ %r[^https?://]
@@ -67,7 +76,7 @@ module Strobe
67
76
 
68
77
  case mime_type
69
78
  when :json
70
- @body = ActiveSupport::JSON.decode(@response.body)
79
+ @body = json_decode(@response.body)
71
80
  else
72
81
  @body = @response.body
73
82
  end
@@ -113,6 +122,13 @@ module Strobe
113
122
  :json
114
123
  end
115
124
  end
125
+
126
+ def json_decode(data)
127
+ ActiveSupport::JSON.decode(@response.body)
128
+ rescue ActiveSupport::JSON.parse_error => e
129
+ raise JSONParseError.new(e, data)
130
+ end
131
+
116
132
  end
117
133
 
118
134
  class Request
@@ -1,3 +1,3 @@
1
1
  module Strobe
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
3
3
  end
metadata CHANGED
@@ -1,113 +1,115 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: strobe
3
- version: !ruby/object:Gem::Version
4
- version: 0.3.5
3
+ version: !ruby/object:Gem::Version
5
4
  prerelease:
5
+ version: 0.3.6
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Carl Lerche
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-01 00:00:00.000000000Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
12
+
13
+ date: 2011-09-02 00:00:00 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
15
16
  name: activemodel
16
- requirement: &2156401120 !ruby/object:Gem::Requirement
17
+ prerelease: false
18
+ requirement: &id001 !ruby/object:Gem::Requirement
17
19
  none: false
18
- requirements:
20
+ requirements:
19
21
  - - ~>
20
- - !ruby/object:Gem::Version
22
+ - !ruby/object:Gem::Version
21
23
  version: 3.0.0
22
24
  type: :runtime
23
- prerelease: false
24
- version_requirements: *2156401120
25
- - !ruby/object:Gem::Dependency
25
+ version_requirements: *id001
26
+ - !ruby/object:Gem::Dependency
26
27
  name: mime-types
27
- requirement: &2156400360 !ruby/object:Gem::Requirement
28
+ prerelease: false
29
+ requirement: &id002 !ruby/object:Gem::Requirement
28
30
  none: false
29
- requirements:
31
+ requirements:
30
32
  - - ~>
31
- - !ruby/object:Gem::Version
33
+ - !ruby/object:Gem::Version
32
34
  version: 1.16.0
33
35
  type: :runtime
34
- prerelease: false
35
- version_requirements: *2156400360
36
- - !ruby/object:Gem::Dependency
36
+ version_requirements: *id002
37
+ - !ruby/object:Gem::Dependency
37
38
  name: rack
38
- requirement: &2156399500 !ruby/object:Gem::Requirement
39
+ prerelease: false
40
+ requirement: &id003 !ruby/object:Gem::Requirement
39
41
  none: false
40
- requirements:
42
+ requirements:
41
43
  - - ~>
42
- - !ruby/object:Gem::Version
44
+ - !ruby/object:Gem::Version
43
45
  version: 1.3.0
44
46
  type: :runtime
45
- prerelease: false
46
- version_requirements: *2156399500
47
- - !ruby/object:Gem::Dependency
47
+ version_requirements: *id003
48
+ - !ruby/object:Gem::Dependency
48
49
  name: thin
49
- requirement: &2156398360 !ruby/object:Gem::Requirement
50
+ prerelease: false
51
+ requirement: &id004 !ruby/object:Gem::Requirement
50
52
  none: false
51
- requirements:
53
+ requirements:
52
54
  - - ~>
53
- - !ruby/object:Gem::Version
55
+ - !ruby/object:Gem::Version
54
56
  version: 1.2.0
55
57
  type: :runtime
56
- prerelease: false
57
- version_requirements: *2156398360
58
- - !ruby/object:Gem::Dependency
58
+ version_requirements: *id004
59
+ - !ruby/object:Gem::Dependency
59
60
  name: em-http-request
60
- requirement: &2156397400 !ruby/object:Gem::Requirement
61
+ prerelease: false
62
+ requirement: &id005 !ruby/object:Gem::Requirement
61
63
  none: false
62
- requirements:
64
+ requirements:
63
65
  - - ~>
64
- - !ruby/object:Gem::Version
66
+ - !ruby/object:Gem::Version
65
67
  version: 1.0.0.beta
66
68
  type: :runtime
67
- prerelease: false
68
- version_requirements: *2156397400
69
- - !ruby/object:Gem::Dependency
69
+ version_requirements: *id005
70
+ - !ruby/object:Gem::Dependency
70
71
  name: thor
71
- requirement: &2156389880 !ruby/object:Gem::Requirement
72
+ prerelease: false
73
+ requirement: &id006 !ruby/object:Gem::Requirement
72
74
  none: false
73
- requirements:
75
+ requirements:
74
76
  - - ~>
75
- - !ruby/object:Gem::Version
77
+ - !ruby/object:Gem::Version
76
78
  version: 0.14.0
77
79
  type: :runtime
78
- prerelease: false
79
- version_requirements: *2156389880
80
- - !ruby/object:Gem::Dependency
80
+ version_requirements: *id006
81
+ - !ruby/object:Gem::Dependency
81
82
  name: oauth
82
- requirement: &2156388480 !ruby/object:Gem::Requirement
83
+ prerelease: false
84
+ requirement: &id007 !ruby/object:Gem::Requirement
83
85
  none: false
84
- requirements:
86
+ requirements:
85
87
  - - ~>
86
- - !ruby/object:Gem::Version
88
+ - !ruby/object:Gem::Version
87
89
  version: 0.4.5
88
90
  type: :runtime
89
- prerelease: false
90
- version_requirements: *2156388480
91
- - !ruby/object:Gem::Dependency
91
+ version_requirements: *id007
92
+ - !ruby/object:Gem::Dependency
92
93
  name: launchy
93
- requirement: &2156386900 !ruby/object:Gem::Requirement
94
+ prerelease: false
95
+ requirement: &id008 !ruby/object:Gem::Requirement
94
96
  none: false
95
- requirements:
96
- - - ! '>='
97
- - !ruby/object:Gem::Version
98
- version: '0'
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: "0"
99
101
  type: :runtime
100
- prerelease: false
101
- version_requirements: *2156386900
102
- description: The client library for deploying applications to Strobe's HTML5 deployment
103
- platform
104
- email:
102
+ version_requirements: *id008
103
+ description: The client library for deploying applications to Strobe's HTML5 deployment platform
104
+ email:
105
105
  - carl@strobecorp.com
106
- executables:
106
+ executables:
107
107
  - strobe
108
108
  extensions: []
109
+
109
110
  extra_rdoc_files: []
110
- files:
111
+
112
+ files:
111
113
  - lib/strobe/addons/social/facebook.rb
112
114
  - lib/strobe/addons/social/twitter.rb
113
115
  - lib/strobe/addons/social.rb
@@ -156,26 +158,30 @@ files:
156
158
  - bin/strobe
157
159
  homepage: http://rubygems.org/gems/strobe
158
160
  licenses: []
161
+
159
162
  post_install_message:
160
163
  rdoc_options: []
161
- require_paths:
164
+
165
+ require_paths:
162
166
  - lib
163
- required_ruby_version: !ruby/object:Gem::Requirement
167
+ required_ruby_version: !ruby/object:Gem::Requirement
164
168
  none: false
165
- requirements:
166
- - - ! '>='
167
- - !ruby/object:Gem::Version
168
- version: '0'
169
- required_rubygems_version: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - ">="
171
+ - !ruby/object:Gem::Version
172
+ version: "0"
173
+ required_rubygems_version: !ruby/object:Gem::Requirement
170
174
  none: false
171
- requirements:
172
- - - ! '>='
173
- - !ruby/object:Gem::Version
175
+ requirements:
176
+ - - ">="
177
+ - !ruby/object:Gem::Version
174
178
  version: 1.3.6
175
179
  requirements: []
180
+
176
181
  rubyforge_project: strobe
177
182
  rubygems_version: 1.8.6
178
183
  signing_key:
179
184
  specification_version: 3
180
185
  summary: A deployment tool for HTML5 applications
181
186
  test_files: []
187
+