kotsms2 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b6a65925dfc194dbb5a11b89fc0f827576537297
4
- data.tar.gz: 28254058990bdfce873d5d94f70e45fd8e011949
3
+ metadata.gz: 5296875c0b1b8a755e8552f54a58660f26349f70
4
+ data.tar.gz: 22e473ec7a42c8b02a2f2c84ea096a0e24e3dc7e
5
5
  SHA512:
6
- metadata.gz: 4d789449dc7212ba3105b1a04d7e40ffb951a4c993a4bfd94148136d778ffff250e476a26be1a60f57d59c2b4844f89ceba0e60000168442129fba8edc077421
7
- data.tar.gz: 567a8409d0819038ff613675bf744631b966edaed600d3abcbc7369ea1cc58a5da226db93d867b766f1e546250336d094107c77aedcb015cd6f41f3eb9156841
6
+ metadata.gz: 8e6301990768aa5a7ea71ea42a7bf039bbaf8a75cb7ceefbc827ecdfbe3f413e5fa6eb8eb880f1e96097f131f5d405bfec562579670975452e90f03f964a386a
7
+ data.tar.gz: f7e1889421d00d4bea51523c8fee0969d18434c29feca67faa556d55128c15b587e9737a872d514b722ff1743a11a9a5832acbedc0669d92fa3b104ba075722d
data/README.md CHANGED
@@ -1,7 +1,9 @@
1
1
  Kotsms2 ( 2016 新版 簡訊王 KotSMS API Ruby 版套件 )
2
2
  =================================================
3
3
 
4
- [![Gem Version](https://badge.fury.io/rb/kotsms2.svg)](https://badge.fury.io/rb/kotsms2) [![Build Status](https://travis-ci.org/guanting112/kotsms2.svg?branch=master)](https://travis-ci.org/guanting112/kotsms2)
4
+ [![Gem Version](https://badge.fury.io/rb/kotsms2.svg)](https://badge.fury.io/rb/kotsms2)
5
+ [![Build Status](https://travis-ci.org/guanting112/kotsms2.svg?branch=master)](https://travis-ci.org/guanting112/kotsms2)
6
+ [![Code Climate](https://codeclimate.com/github/guanting112/kotsms2/badges/gpa.svg)](https://codeclimate.com/github/guanting112/kotsms2)
5
7
 
6
8
  ![kotsms](http://i.imgur.com/Q4QbtOP.png)
7
9
 
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
- require "bundler/gem_tasks"
2
- require "rake/testtask"
1
+ require 'bundler/gem_tasks'
2
+ require 'rake/testtask'
3
3
 
4
4
  task :default => :spec
5
5
 
data/bin/console CHANGED
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "bundler/setup"
4
- require "kotsms2"
3
+ require 'bundler/setup'
4
+ require 'kotsms2'
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
8
8
 
9
9
  # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
10
+ # require 'pry'
11
11
  # Pry.start
12
12
 
13
- require "irb"
13
+ require 'irb'
14
14
  IRB.start
@@ -1,11 +1,11 @@
1
1
  module Kotsms2
2
2
  module Formatter
3
- def to_big5(old_string)
4
- new_string = old_string.encode("BIG5", :invalid => :replace, :undef => :replace, :replace => "?")
3
+ def to_big5(original_string)
4
+ original_string.encode("BIG5", :invalid => :replace, :undef => :replace, :replace => "?")
5
5
  end
6
6
 
7
- def to_utf8(old_string)
8
- new_string = old_string.encode("UTF-8", :invalid => :replace, :undef => :replace, :replace => "?")
7
+ def to_utf8(original_string)
8
+ original_string.encode("UTF-8", :invalid => :replace, :undef => :replace, :replace => "?")
9
9
  end
10
10
 
11
11
  def match_string(rule, string)
@@ -40,9 +40,7 @@ module Kotsms2
40
40
  if new_info[:access_success]
41
41
  new_info[:message_id] = code_number.to_s
42
42
  else
43
- new_info[:error] = "KOTSMS:CODE_NOT_FOUND"
44
- new_info[:error] = "KOTSMS:#{code_text}" unless code_text.nil?
45
- new_info[:error].upcase!
43
+ new_info[:error] = code_text.nil? ? "KOTSMS:CODE_NOT_FOUND" : "KOTSMS:#{code_text}".upcase
46
44
  end
47
45
 
48
46
  new_info
@@ -63,9 +61,7 @@ module Kotsms2
63
61
  if new_info[:access_success]
64
62
  new_info[:message_quota] = code_number
65
63
  else
66
- new_info[:error] = "KOTSMS:CODE_NOT_FOUND"
67
- new_info[:error] = "KOTSMS:#{code_text}" unless code_text.nil?
68
- new_info[:error].upcase!
64
+ new_info[:error] = code_text.nil? ? "KOTSMS:CODE_NOT_FOUND" : "KOTSMS:#{code_text}".upcase
69
65
  end
70
66
 
71
67
  new_info
@@ -1,3 +1,3 @@
1
1
  module Kotsms2
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
data/lib/kotsms2.rb CHANGED
@@ -17,8 +17,7 @@ module Kotsms2
17
17
 
18
18
  def account_is_available
19
19
  balance_info = get_balance
20
-
21
- ok = balance_info[:message_quota] > 0 && balance_info[:access_success]
20
+ balance_info[:message_quota] > 0 && balance_info[:access_success]
22
21
  end
23
22
 
24
23
  def send_message(options={})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kotsms2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guanting Chen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-03 00:00:00.000000000 Z
11
+ date: 2016-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  version: '0'
95
95
  requirements: []
96
96
  rubyforge_project:
97
- rubygems_version: 2.6.4
97
+ rubygems_version: 2.5.1
98
98
  signing_key:
99
99
  specification_version: 4
100
100
  summary: 2016 新版 簡訊王 KotSMS API ( 純 Ruby / Rails 專案適用 )