mnotifier 0.0.1

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: 1b634bf039c85ac685fc7181b9d74d1af8830fbf
4
+ data.tar.gz: 0f426d77a48133ec5bac8e5cb79ba401e4c144cf
5
+ SHA512:
6
+ metadata.gz: e2c1c4182aa147975e3fd39a0b30e9dbd405ccfa40a0e7331c6ac8b9ce5aa845c8e893f562ed5684ec3b81e8dcc21f4c4f956c4780bec16cf2d39d54605f5bc8
7
+ data.tar.gz: f9f3788fd7f34579bfbf2c5c1e1b6b098e515e1130e95d78b551211e24ad7f70e141549ae0c659e4b31c50cad73644973e00d79b40785a5e16126095c64632bb
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ coverage
6
+ InstalledFiles
7
+ lib/bundler/man
8
+ pkg
9
+ rdoc
10
+ spec/reports
11
+ test/tmp
12
+ test/version_tmp
13
+ tmp
14
+
15
+ # YARD artifacts
16
+ .yardoc
17
+ _yardoc
18
+ doc/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in mnotifier.gemspec
4
+ gemspec
@@ -0,0 +1,178 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ mnotifier (0.0.1)
5
+ sinatra
6
+ thin
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ activesupport (4.0.2)
12
+ i18n (~> 0.6, >= 0.6.4)
13
+ minitest (~> 4.2)
14
+ multi_json (~> 1.3)
15
+ thread_safe (~> 0.1)
16
+ tzinfo (~> 0.3.37)
17
+ arrayfields (4.9.0)
18
+ atomic (1.1.14)
19
+ awesome_print (1.2.0)
20
+ cane (2.6.1)
21
+ parallel
22
+ celluloid (0.15.2)
23
+ timers (~> 1.1.0)
24
+ chronic (0.10.2)
25
+ churn (0.0.35)
26
+ chronic (>= 0.2.3)
27
+ hirb
28
+ json_pure
29
+ main
30
+ rest-client (>= 1.6.0)
31
+ ruby_parser (~> 3.0)
32
+ sexp_processor (~> 4.1)
33
+ code_analyzer (0.4.4)
34
+ sexp_processor
35
+ code_metrics (0.1.3)
36
+ coderay (1.1.0)
37
+ colored (1.2)
38
+ daemons (1.1.9)
39
+ diff-lcs (1.2.5)
40
+ docile (1.1.3)
41
+ erubis (2.7.0)
42
+ eventmachine (1.0.3)
43
+ fakefs (0.5.0)
44
+ fattr (2.2.1)
45
+ ffi (1.9.3)
46
+ flay (2.4.0)
47
+ ruby_parser (~> 3.0)
48
+ sexp_processor (~> 4.0)
49
+ flog (4.2.0)
50
+ ruby_parser (~> 3.1, > 3.1.0)
51
+ sexp_processor (~> 4.4)
52
+ formatador (0.2.4)
53
+ guard (2.4.0)
54
+ formatador (>= 0.2.4)
55
+ listen (~> 2.1)
56
+ lumberjack (~> 1.0)
57
+ pry (>= 0.9.12)
58
+ thor (>= 0.18.1)
59
+ guard-rspec (4.2.6)
60
+ guard (~> 2.1)
61
+ rspec (>= 2.14, < 4.0)
62
+ hirb (0.7.1)
63
+ i18n (0.6.9)
64
+ json_pure (1.8.1)
65
+ listen (2.4.1)
66
+ celluloid (>= 0.15.2)
67
+ rb-fsevent (>= 0.9.3)
68
+ rb-inotify (>= 0.9)
69
+ lumberjack (1.0.4)
70
+ main (5.2.0)
71
+ arrayfields (>= 4.7.4)
72
+ chronic (>= 0.6.2)
73
+ fattr (>= 2.2.0)
74
+ map (>= 5.1.0)
75
+ map (6.5.1)
76
+ method_source (0.8.2)
77
+ metric_fu (4.7.3)
78
+ cane (~> 2.5, >= 2.5.2)
79
+ churn (~> 0.0.35)
80
+ code_metrics (~> 0.1)
81
+ coderay
82
+ flay (~> 2.1, >= 2.0.1)
83
+ flog (~> 4.1, >= 4.1.1)
84
+ metric_fu-Saikuro (~> 1.1, >= 1.1.3)
85
+ multi_json
86
+ rails_best_practices (~> 1.14, >= 1.14.3)
87
+ redcard
88
+ reek (~> 1.3, >= 1.3.4)
89
+ roodi (~> 3.1)
90
+ metric_fu-Saikuro (1.1.3)
91
+ mime-types (2.1)
92
+ minitest (4.7.5)
93
+ multi_json (1.8.4)
94
+ parallel (0.9.2)
95
+ pry (0.9.12.6)
96
+ coderay (~> 1.0)
97
+ method_source (~> 0.8)
98
+ slop (~> 3.4)
99
+ rack (1.5.2)
100
+ rack-protection (1.5.2)
101
+ rack
102
+ rack-test (0.6.2)
103
+ rack (>= 1.0)
104
+ rails_best_practices (1.15.1)
105
+ activesupport
106
+ awesome_print
107
+ code_analyzer (>= 0.4.3)
108
+ colored
109
+ erubis
110
+ i18n
111
+ require_all
112
+ ruby-progressbar
113
+ rake (10.1.1)
114
+ rb-fsevent (0.9.4)
115
+ rb-inotify (0.9.3)
116
+ ffi (>= 0.5.0)
117
+ redcard (1.1.0)
118
+ reek (1.3.6)
119
+ ruby2ruby (~> 2.0.7)
120
+ ruby_parser (~> 3.2)
121
+ sexp_processor
122
+ require_all (1.3.2)
123
+ rest-client (1.6.7)
124
+ mime-types (>= 1.16)
125
+ roodi (3.3.1)
126
+ ruby_parser (~> 3.2, >= 3.2.2)
127
+ rspec (2.14.1)
128
+ rspec-core (~> 2.14.0)
129
+ rspec-expectations (~> 2.14.0)
130
+ rspec-mocks (~> 2.14.0)
131
+ rspec-core (2.14.7)
132
+ rspec-expectations (2.14.5)
133
+ diff-lcs (>= 1.1.3, < 2.0)
134
+ rspec-mocks (2.14.5)
135
+ ruby-progressbar (1.4.1)
136
+ ruby2ruby (2.0.7)
137
+ ruby_parser (~> 3.1)
138
+ sexp_processor (~> 4.0)
139
+ ruby_parser (3.4.0)
140
+ sexp_processor (~> 4.1)
141
+ sexp_processor (4.4.1)
142
+ simplecov (0.8.2)
143
+ docile (~> 1.1.0)
144
+ multi_json
145
+ simplecov-html (~> 0.8.0)
146
+ simplecov-html (0.8.0)
147
+ simplecov-rcov-text (0.0.2)
148
+ sinatra (1.4.4)
149
+ rack (~> 1.4)
150
+ rack-protection (~> 1.4)
151
+ tilt (~> 1.3, >= 1.3.4)
152
+ slop (3.4.7)
153
+ thin (1.6.1)
154
+ daemons (>= 1.0.9)
155
+ eventmachine (>= 1.0.0)
156
+ rack (>= 1.0.0)
157
+ thor (0.18.1)
158
+ thread_safe (0.1.3)
159
+ atomic
160
+ tilt (1.4.1)
161
+ timers (1.1.0)
162
+ tzinfo (0.3.38)
163
+
164
+ PLATFORMS
165
+ ruby
166
+
167
+ DEPENDENCIES
168
+ bundler (~> 1.5)
169
+ fakefs
170
+ guard
171
+ guard-rspec
172
+ metric_fu
173
+ mnotifier!
174
+ rack-test
175
+ rake
176
+ rspec
177
+ simplecov
178
+ simplecov-rcov-text
@@ -0,0 +1,9 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard :rspec do
5
+ watch(%r{^spec/.+_spec\.rb$})
6
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
7
+ watch('spec/spec_helper.rb') { "spec" }
8
+ end
9
+
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Minwoo Lee
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,4 @@
1
+ mnotifier
2
+ =========
3
+
4
+ Notifier
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,3 @@
1
+ require 'mnotifier'
2
+
3
+ run MNotifier::Notification
@@ -0,0 +1,5 @@
1
+ require 'mnotifier/version'
2
+
3
+ module MNotifier
4
+ autoload :Notification, 'mnotifier/notification'
5
+ end
@@ -0,0 +1,30 @@
1
+ require 'sinatra/base'
2
+ require 'digest/sha1'
3
+
4
+ module MNotifier
5
+ class Notification < Sinatra::Base
6
+ configure do
7
+ @@notifications = {}
8
+ end
9
+
10
+ get '/notifications' do
11
+ <<-EOS
12
+ <form method=post enctype='multipart/form-data'>
13
+ <input name=detail />
14
+ <input type=submit />
15
+ </form>
16
+ EOS
17
+ end
18
+
19
+ get '/notifications/*' do |key|
20
+ @@notifications[key]
21
+ end
22
+
23
+ post '/notifications' do
24
+ value = params[:detail]
25
+ key = Digest::SHA1.hexdigest(value)
26
+ @@notifications[key] = value
27
+ "#{request.url}/#{key}"
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,3 @@
1
+ module MNotifier
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,33 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'mnotifier/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "mnotifier"
8
+ spec.version = MNotifier::VERSION
9
+ spec.authors = ["Minwoo Lee"]
10
+ spec.email = ["ermaker@gmail.com"]
11
+ spec.summary = %q{MNotifier}
12
+ spec.description = %q{}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency "sinatra"
22
+ spec.add_dependency "thin"
23
+ spec.add_development_dependency "bundler", "~> 1.5"
24
+ spec.add_development_dependency "rake"
25
+ spec.add_development_dependency "rspec"
26
+ spec.add_development_dependency "rack-test"
27
+ spec.add_development_dependency "fakefs"
28
+ spec.add_development_dependency "guard"
29
+ spec.add_development_dependency "guard-rspec"
30
+ spec.add_development_dependency "metric_fu"
31
+ spec.add_development_dependency "simplecov"
32
+ spec.add_development_dependency "simplecov-rcov-text"
33
+ end
@@ -0,0 +1,25 @@
1
+ ENV['RACK_ENV'] = 'test'
2
+
3
+ require 'spec_helper'
4
+ require 'rack/test'
5
+ require 'fakefs/spec_helpers'
6
+ require 'mnotifier/notification'
7
+
8
+ describe 'MNotifier App' do
9
+ include Rack::Test::Methods
10
+ include FakeFS::SpecHelpers
11
+
12
+ def app
13
+ MNotifier::Notification.new
14
+ end
15
+
16
+ it 'posts notifications and gets the notification' do
17
+ post '/notifications', detail: 'detail description'
18
+ last_response.body.should == 'http://example.org/notifications/033d92cc16d782809355e5800042faedf4005641'
19
+ last_response.should be_ok
20
+
21
+ get '/notifications/033d92cc16d782809355e5800042faedf4005641'
22
+ last_response.body.should == 'detail description'
23
+ last_response.should be_ok
24
+ end
25
+ end
@@ -0,0 +1,32 @@
1
+ # This file was generated by the `rspec --init` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # Require this file using `require "spec_helper"` to ensure that it is only
4
+ # loaded once.
5
+ #
6
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
7
+ if ENV['COVERAGE']
8
+ require 'simplecov'
9
+ formatters = [SimpleCov::Formatter::HTMLFormatter]
10
+ begin
11
+ puts '[COVERAGE] Running with SimpleCov HTML Formatter'
12
+ require 'simplecov-rcov-text'
13
+ formatters << SimpleCov::Formatter::RcovTextFormatter
14
+ puts '[COVERAGE] Running with SimpleCov Rcov Formatter'
15
+ rescue LoadError
16
+ puts '[COVERAGE] SimpleCov Rcov formatter could not be loaded'
17
+ end
18
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ *formatters ]
19
+ SimpleCov.start
20
+ end
21
+
22
+ RSpec.configure do |config|
23
+ config.treat_symbols_as_metadata_keys_with_true_values = true
24
+ config.run_all_when_everything_filtered = true
25
+ config.filter_run :focus
26
+
27
+ # Run specs in random order to surface order dependencies. If you find an
28
+ # order dependency and want to debug it, you can fix the order by providing
29
+ # the seed, which is printed after each run.
30
+ # --seed 1234
31
+ config.order = 'random'
32
+ end
metadata ADDED
@@ -0,0 +1,229 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mnotifier
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Minwoo Lee
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-02-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: sinatra
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
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: thin
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
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: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.5'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.5'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rack-test
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: fakefs
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: guard
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: guard-rspec
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'
139
+ - !ruby/object:Gem::Dependency
140
+ name: metric_fu
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: simplecov
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: simplecov-rcov-text
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ description: ''
182
+ email:
183
+ - ermaker@gmail.com
184
+ executables: []
185
+ extensions: []
186
+ extra_rdoc_files: []
187
+ files:
188
+ - ".gitignore"
189
+ - ".rspec"
190
+ - Gemfile
191
+ - Gemfile.lock
192
+ - Guardfile
193
+ - LICENSE
194
+ - README.md
195
+ - Rakefile
196
+ - config.ru
197
+ - lib/mnotifier.rb
198
+ - lib/mnotifier/notification.rb
199
+ - lib/mnotifier/version.rb
200
+ - mnotifier.gemspec
201
+ - spec/lib/mnotifier/notification_spec.rb
202
+ - spec/spec_helper.rb
203
+ homepage: ''
204
+ licenses:
205
+ - MIT
206
+ metadata: {}
207
+ post_install_message:
208
+ rdoc_options: []
209
+ require_paths:
210
+ - lib
211
+ required_ruby_version: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - ">="
214
+ - !ruby/object:Gem::Version
215
+ version: '0'
216
+ required_rubygems_version: !ruby/object:Gem::Requirement
217
+ requirements:
218
+ - - ">="
219
+ - !ruby/object:Gem::Version
220
+ version: '0'
221
+ requirements: []
222
+ rubyforge_project:
223
+ rubygems_version: 2.2.1
224
+ signing_key:
225
+ specification_version: 4
226
+ summary: MNotifier
227
+ test_files:
228
+ - spec/lib/mnotifier/notification_spec.rb
229
+ - spec/spec_helper.rb