daioikachan 0.0.4 → 0.0.5

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: c78f4bd1547342b095bc02952b999849adea8af0
4
- data.tar.gz: f153c9627506286d977d77b436cedc27d5cf1c83
3
+ metadata.gz: 47150b0d6c93fcda75508f92aa41cd335e5f656c
4
+ data.tar.gz: 107674f0f8f789feb52d7b9a29b453cbd7083e0d
5
5
  SHA512:
6
- metadata.gz: 8279164a4f7f8ba7a9ec3fda48b0428ee4cebe01bb53b76d172d4e4f9aba15aae4654c04f833db848f30376b6a5fbb15bbe8e955682e32f495dd0da7f37c2465
7
- data.tar.gz: 0d959a59d2bbacffe1f717c578225fcbd70c525897ab76128ae967fa4d22fef9f17948a1296731d615083a2200d617e35ed5d3944b764f9108cb99412533a4ef
6
+ metadata.gz: 06ea59e9cbbf5e86fc1c45f1664bcfd546817cb7fcc73f4721a85b260194c79f76f5cc664e023a56f16c1ff05a53d9abbcaffdc3c8e8759bcfc5d55430bcb5c4
7
+ data.tar.gz: 4edb9ea8b4a7159ed26f2b823915a62b446cb31ba3548f408fc3b9922beae99a6dbb669688642791ac3307478b78823377ee9d824f665373ca79d599452c4114
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.0.5 (2015/03/30)
2
+
3
+ Changes:
4
+
5
+ * Use Rack::Request to handle both `application/x-www-form-urlencoded` and `multipart/form-data`.
6
+
1
7
  # 0.0.4 (2015/03/30)
2
8
 
3
9
  Enhancements:
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
data/daioikachan.gemspec CHANGED
@@ -21,6 +21,9 @@ Gem::Specification.new do |gem|
21
21
  gem.add_dependency "puma"
22
22
  gem.add_dependency "fluent-plugin-irc", ">= 0.0.7"
23
23
  gem.add_dependency "fluent-plugin-slack", ">= 0.5.0"
24
+
24
25
  gem.add_development_dependency "rake"
25
26
  gem.add_development_dependency "test-unit"
27
+ gem.add_development_dependency "pry"
28
+ gem.add_development_dependency "pry-nav"
26
29
  end
@@ -71,20 +71,11 @@ module Fluent
71
71
  end
72
72
 
73
73
  def run(env)
74
- # req = Rack::Request.new(env)
75
- method = env['REQUEST_METHOD'.freeze] # req.method
76
- path = URI.parse(env['REQUEST_URI'.freeze]).path # req.path
77
- # Rack::Request.new should take care of this, but it did not
78
- if env['CONTENT_TYPE'.freeze].start_with?('multipart/form-data'.freeze)
79
- params = Rack::Multipart.parse_multipart(env)
80
- else
81
- body = env['rack.input'].read # req.body.read
82
- params = Rack::Utils.parse_query(body)
83
- end
84
-
74
+ req = Rack::Request.new(env)
85
75
  begin
86
- if method == 'POST'
87
- case path
76
+ if req.post?
77
+ params = req.params
78
+ case req.path
88
79
  when '/notice'
89
80
  notice(params)
90
81
  when '/privmsg'
@@ -137,7 +137,6 @@ class DaioikachanInputTest < Test::Unit::TestCase
137
137
  d.run do
138
138
  d.expected_emits.each {|tag, time, record|
139
139
  res = post_multipart("/privmsg", {command: "privmsg", channel: "channel", message: "message"})
140
- puts res.body
141
140
  assert_equal "200", res.code
142
141
  }
143
142
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daioikachan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo
@@ -108,6 +108,34 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: pry
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: pry-nav
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
111
139
  description: Ikachan compatible interface with multiple backends (IRC, Slack, etc)
112
140
  email: sonots@gmail.com
113
141
  executables: