lesspainful 0.10.2 → 0.10.3

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/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lesspainful (0.10.2)
4
+ lesspainful (0.10.3)
5
5
  bundler (~> 1.2)
6
6
  json
7
7
  rest-client (= 1.6.7)
@@ -17,6 +17,10 @@ module LessPainful
17
17
 
18
18
  attr_accessor :endpoint_path
19
19
 
20
+ FILE_UPLOAD_ENDPOINT = "upload2"
21
+ FORM_URL_ENCODED_ENDPOINT = "upload"
22
+
23
+
20
24
  def self.source_root
21
25
  File.join(File.dirname(__FILE__), '..')
22
26
  end
@@ -73,11 +77,10 @@ module LessPainful
73
77
 
74
78
  self.host = options[:host]
75
79
 
76
- unless self.host
77
- self.endpoint_path = "upload" #invoked old-style
80
+ unless self.host #if invoked though old-style
78
81
  self.host = ENV["LP_HOST"] || 'https://www.lesspainful.com'
79
82
  else
80
- self.endpoint_path = "upload2" #nginx receives upload
83
+
81
84
  end
82
85
 
83
86
  app_path = File.expand_path(app)
@@ -203,6 +206,21 @@ module LessPainful
203
206
  end
204
207
 
205
208
 
209
+ contains_file = files.find {|f| f.is_a?(File)}
210
+
211
+ contains_file = contains_file || app_file.is_a?(File)
212
+
213
+ if contains_file
214
+ self.endpoint_path = FILE_UPLOAD_ENDPOINT #nginx receives upload
215
+ else
216
+ self.endpoint_path = FORM_URL_ENCODED_ENDPOINT #ruby receives upload
217
+ end
218
+
219
+ if ENV['DEBUG']
220
+ puts "Will upload to file path: #{self.endpoint_path}"
221
+ end
222
+
223
+
206
224
  response = http_post(endpoint_path,upload_data) do |response, request, result, &block|
207
225
  case response.code
208
226
  when 200..202
@@ -376,7 +394,7 @@ module LessPainful
376
394
  if is_android?
377
395
  files << test_server_path
378
396
  end
379
- p files
397
+
380
398
  {:feature_prefix => dir, :workspace_prefix => workspace, :files => files.find_all { |file_or_dir| File.file? file_or_dir }}
381
399
  end
382
400
 
@@ -1,3 +1,3 @@
1
1
  module LessPainful
2
- VERSION = "0.10.2"
2
+ VERSION = "0.10.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lesspainful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.2
4
+ version: 0.10.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-10 00:00:00.000000000 Z
12
+ date: 2013-03-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor