unp_smart 0.1.3 → 0.1.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3ce740109f740c935d0ca164a98f35458c20913c
4
- data.tar.gz: 89a461ee12e299437fd5b0738791a34f21496467
3
+ metadata.gz: f0a5c384aff43664f39121b949491ebae2614c81
4
+ data.tar.gz: 02e8d044dc1661f4622cb4fb3867f786be4108f4
5
5
  SHA512:
6
- metadata.gz: 5953e3f54190b129cbe1a84047a127f67f077e89770e0360a094d5755fba887f8b5bd7ac29d4e3bd4c2aae7a8bb2c995428ee5c1865d36d5b45259a1a0197897
7
- data.tar.gz: afa443bd205c09c41e4103969e0b60d8f1652813801f1e8c535ad130d48d00da74c7b550f87023bed209a1b5570a32859e3ee29ce34260962bc85c2154d1e012
6
+ metadata.gz: 4b18ae2a1c334ed88e7dc29a2c9e64703bdcd4aeca0c52f6b95dbcd64628c86c5a5ed3cc13affaebc43e57f2686ec5294a1ed1c0988ac90da941fb43a7daf27b
7
+ data.tar.gz: 8da9aadc62ebd1b67812dd57e04924347416ec77c1ceb49de98abce3a87aff391720a12cdfc35d0139ea3c64e09dc7018a4155845ce282246b77f4b3a0ed61a2
data/Gemfile.lock CHANGED
@@ -1,7 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- unp_smart (0.1.2)
4
+ unp_smart (0.1.3)
5
+ activesupport (~> 4.1)
6
+ rest-client (~> 1.7)
5
7
 
6
8
  GEM
7
9
  remote: https://rubygems.org/
@@ -42,9 +44,7 @@ PLATFORMS
42
44
  ruby
43
45
 
44
46
  DEPENDENCIES
45
- activesupport (~> 4.1)
46
47
  bundler (~> 1.6)
47
48
  rake (~> 10.4)
48
- rest-client (~> 1.7)
49
49
  rspec (~> 3.1)
50
50
  unp_smart!
data/bin/unpsmart CHANGED
@@ -36,7 +36,7 @@ if ARGV.length >0
36
36
  begin
37
37
  invoke_api http_method,api_path,params
38
38
  rescue => e
39
- puts "invoke api error,got:#{e}"
39
+ puts "invoke api error,got:#{e.inspect}"
40
40
  end
41
41
  else
42
42
  puts "Usage:\n\tunpsmart [get/post] api_path key1 value1 key2 value2 [...]"
@@ -105,8 +105,8 @@ module UnpSmart
105
105
  log "config file path",path
106
106
  @config ||= YAML.load_file(path)[current_env]
107
107
  log "config:#{@config}" if @verbose
108
- # rescue => e
109
- # log "load config error:#{e.inspect}"
108
+ rescue => e
109
+ log "load config error:#{e.inspect}"
110
110
  end
111
111
 
112
112
  private
@@ -117,7 +117,7 @@ module UnpSmart
117
117
  end
118
118
 
119
119
  def get_variable_from_params key
120
- @params[key.to_sym]
120
+ @params[key.to_sym] if @params.present?
121
121
  end
122
122
 
123
123
  def get_variable_from_env key
@@ -145,7 +145,7 @@ module UnpSmart
145
145
  end
146
146
 
147
147
  def current_env
148
- rails_app? ? Rails.env : 'development'
148
+ rails_app? ? Rails.env : (ENV['UNPSMART_ENV'].presence||'development')
149
149
  end
150
150
 
151
151
  def rails_app?
@@ -1,3 +1,3 @@
1
1
  module UnpSmart
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unp_smart
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Xu