im-kayac 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1f27dee37fdd6cb16262949cdb2b0a934e31673b
4
+ data.tar.gz: 39de664fc8d354728cabce088a651f343a0a93b1
5
+ SHA512:
6
+ metadata.gz: ca55556f3f5ae0e96fc175c3e0364341ae009081fbb199a6b1df2a3cd1a00c7c6da6a60d61929a557cf6aa251b50a7ae82d214e60d37be5c6bc9c4fae45ae41a
7
+ data.tar.gz: a0a465897f555cc31859373d7ca28f54ea68cd1097561898bb0343b29d0a18036d05c1e2e3db768e98030ad27b54fb4b547b83b48f553e7ea5af702d1376d406
@@ -1,3 +1,8 @@
1
+ === 0.1.2 2013-05-02
2
+
3
+ * add handler option for iPhone's custom URL Scheme
4
+ * thank you for contributing @june29
5
+
1
6
  === 0.1.1 2013-03-14
2
7
 
3
8
  * add im-kayac command
data/README.md CHANGED
@@ -41,6 +41,12 @@ secret key
41
41
  ImKayac.to('username').secret('your-key').post('hello')
42
42
  ```
43
43
 
44
+ iPhone URL Scheme Handler
45
+ ```ruby
46
+ ImKayac.to('username').handler('tweetie://').post('hello')
47
+ ImKayac.to('username').handler('mailto:example@example.com').post('hello')
48
+ ```
49
+
44
50
 
45
51
  Sample
46
52
  ------
@@ -8,6 +8,7 @@ parser = ArgsParser.parse ARGV do
8
8
  arg :to, 'message to', :alias => :t
9
9
  arg :password, 'password auth', :alias => :p
10
10
  arg :secret, 'secret key auth', :alias => :s
11
+ arg :handler, 'iPhone URL Scheme Handler'
11
12
  arg :version, 'show version', :alias => :v
12
13
  arg :help, 'show help', :alias => :h
13
14
  end
@@ -17,13 +18,14 @@ if parser.has_option? :version
17
18
  exit
18
19
  end
19
20
 
20
- if parser.has_option? :help or !parser.has_param? :to or parser.argv.empty?
21
+ if parser.has_option? :help or !parser.has_param? :to or parser.argv.empty?
21
22
  STDERR.puts parser.help
22
23
  STDERR.puts
23
24
  STDERR.puts "e.g."
24
25
  STDERR.puts %q{ im-kayac --to USER_NAME "hello world"}
25
26
  STDERR.puts %q{ im-kayac --to USER_NAME --password YOUR_PASS "hello password"}
26
27
  STDERR.puts %q{ im-kayac --to USER_NAME --secret YOUR_KEY "hello secret key"}
28
+ STDERR.puts %q{ im-kayac --to USER_NAME --handler twitter://twitter.com/shokai "open twitter"}
27
29
  exit 1
28
30
  end
29
31
 
@@ -33,4 +35,6 @@ if parser.has_param? :password
33
35
  elsif parser.has_param? :secret
34
36
  im.secret parser[:secret]
35
37
  end
38
+ im.handler parser[:handler] if parser.has_param? :handler
39
+
36
40
  im.post parser.argv.join ''
@@ -6,6 +6,7 @@ module ImKayac
6
6
  @to = nil
7
7
  @secret = nil
8
8
  @password = nil
9
+ @handler = nil
9
10
  end
10
11
 
11
12
  def to(name)
@@ -23,10 +24,16 @@ module ImKayac
23
24
  return self
24
25
  end
25
26
 
27
+ def handler(handler)
28
+ @handler = handler
29
+ return self
30
+ end
31
+
26
32
  def post(message)
27
33
  params = {:message => message}
28
34
  params[:sig] = Digest::SHA1.hexdigest "#{message}#{@secret}" if @secret
29
35
  params[:password] = @password if @password
36
+ params[:handler] = @handler if @handler
30
37
 
31
38
  res = HTTParty.post "http://im.kayac.com/api/post/#{@to}", :body => params
32
39
  raise Error.new "response error (#{res.code})" unless res.code == 200
@@ -1,3 +1,3 @@
1
1
  module ImKayac
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,60 +1,65 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: im-kayac
3
- version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.1.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.2
6
5
  platform: ruby
7
- authors:
6
+ authors:
8
7
  - Sho Hashimoto
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
-
13
- date: 2013-03-13 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
11
+ date: 2013-05-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
16
14
  name: json
17
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
19
- none: false
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: "0"
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
24
20
  type: :runtime
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
27
- name: httparty
28
21
  prerelease: false
29
- requirement: &id002 !ruby/object:Gem::Requirement
30
- none: false
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: "0"
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: httparty
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
35
34
  type: :runtime
36
- version_requirements: *id002
37
- - !ruby/object:Gem::Dependency
38
- name: args_parser
39
35
  prerelease: false
40
- requirement: &id003 !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- version: "0"
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: args_parser
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
46
48
  type: :runtime
47
- version_requirements: *id003
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
48
55
  description: post message http://im.kayac.com
49
- email:
56
+ email:
50
57
  - hashimoto@shokai.org
51
- executables:
58
+ executables:
52
59
  - im-kayac
53
60
  extensions: []
54
-
55
61
  extra_rdoc_files: []
56
-
57
- files:
62
+ files:
58
63
  - .gitignore
59
64
  - Gemfile
60
65
  - History.txt
@@ -79,32 +84,28 @@ files:
79
84
  - tasks/rspec.rake
80
85
  homepage: https://github.com/shokai/ruby-im-kayac
81
86
  licenses: []
82
-
87
+ metadata: {}
83
88
  post_install_message:
84
89
  rdoc_options: []
85
-
86
- require_paths:
90
+ require_paths:
87
91
  - lib
88
- required_ruby_version: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - ">="
92
- - !ruby/object:Gem::Version
93
- version: "0"
94
- required_rubygems_version: !ruby/object:Gem::Requirement
95
- none: false
96
- requirements:
97
- - - ">="
98
- - !ruby/object:Gem::Version
99
- version: "0"
92
+ required_ruby_version: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ required_rubygems_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
100
102
  requirements: []
101
-
102
103
  rubyforge_project:
103
- rubygems_version: 1.8.17
104
+ rubygems_version: 2.0.3
104
105
  signing_key:
105
- specification_version: 3
106
+ specification_version: 4
106
107
  summary: post message http://im.kayac.com
107
- test_files:
108
+ test_files:
108
109
  - spec/im-kayac_spec.rb
109
110
  - spec/spec.opts
110
111
  - spec/spec_helper.rb