jellyfish 1.0.1 → 1.0.2
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 +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +1 -1
- data/CHANGES.md +4 -0
- data/Gemfile +3 -0
- data/README.md +2 -1
- data/jellyfish.gemspec +4 -4
- data/lib/jellyfish/newrelic.rb +4 -11
- data/lib/jellyfish/version.rb +1 -1
- data/task/gemgem.rb +100 -51
- data/test/test_swagger.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed0f1e851242bf9537578f804560b70c4941fd99
|
4
|
+
data.tar.gz: 0d90b769bdb5fba1328d8734b5f6ac307578136c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2168d6a1fd9beeb8486065288be32d59347d2e52d5e503efa5898e5ed6666603e8061d16fe269e25aaa831a59054e40bbcfe11adcb64dd7f24fc9201bc0b14d
|
7
|
+
data.tar.gz: d74afc9d0425f7f88b193259785f81da48e990f4dbf2359fafd334cc99926e79384aa41b008e37546520bb48cf95d0b6315d034c87bbb25848583605fbca8ceb
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/CHANGES.md
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Jellyfish[](http://travis-ci.org/godfat/jellyfish)
|
1
|
+
# Jellyfish [](http://travis-ci.org/godfat/jellyfish) [](https://coveralls.io/r/godfat/jellyfish)
|
2
2
|
|
3
3
|
by Lin Jen-Shin ([godfat](http://godfat.org))
|
4
4
|
|
@@ -986,6 +986,7 @@ GET /swagger
|
|
986
986
|
|
987
987
|
## CONTRIBUTORS:
|
988
988
|
|
989
|
+
* Jason R. Clark (@jasonrclark)
|
989
990
|
* Lin Jen-Shin (@godfat)
|
990
991
|
|
991
992
|
## LICENSE:
|
data/jellyfish.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: jellyfish 1.0.
|
2
|
+
# stub: jellyfish 1.0.2 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "jellyfish"
|
6
|
-
s.version = "1.0.
|
6
|
+
s.version = "1.0.2"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib"]
|
10
10
|
s.authors = ["Lin Jen-Shin (godfat)"]
|
11
|
-
s.date = "2014-
|
11
|
+
s.date = "2014-12-09"
|
12
12
|
s.description = "Pico web framework for building API-centric web applications.\nFor Rack applications or Rack middlewares. Around 250 lines of code."
|
13
13
|
s.email = ["godfat (XD) godfat.org"]
|
14
14
|
s.files = [
|
@@ -61,7 +61,7 @@ Gem::Specification.new do |s|
|
|
61
61
|
"test/test_websocket.rb"]
|
62
62
|
s.homepage = "https://github.com/godfat/jellyfish"
|
63
63
|
s.licenses = ["Apache License 2.0"]
|
64
|
-
s.rubygems_version = "2.4.
|
64
|
+
s.rubygems_version = "2.4.5"
|
65
65
|
s.summary = "Pico web framework for building API-centric web applications."
|
66
66
|
s.test_files = [
|
67
67
|
"test/sinatra/test_base.rb",
|
data/lib/jellyfish/newrelic.rb
CHANGED
@@ -14,18 +14,11 @@ module Jellyfish
|
|
14
14
|
argument
|
15
15
|
end.to_s[1..-1]
|
16
16
|
name = "#{env['REQUEST_METHOD']} #{path}"
|
17
|
-
|
18
|
-
perform_action_with_newrelic_trace(:category =>
|
19
|
-
:
|
20
|
-
:
|
21
|
-
:request => request ,
|
17
|
+
|
18
|
+
perform_action_with_newrelic_trace(:category => :rack ,
|
19
|
+
:name => name ,
|
20
|
+
:request => request,
|
22
21
|
:params => request.params){super}
|
23
22
|
end
|
24
23
|
end
|
25
24
|
end
|
26
|
-
|
27
|
-
module NewRelic::MetricParser::WebTransaction::Jellyfish
|
28
|
-
include NewRelic::MetricParser::WebTransaction::Pattern
|
29
|
-
def is_web_transaction?; true; end
|
30
|
-
def category ; 'Jellyfish'; end
|
31
|
-
end
|
data/lib/jellyfish/version.rb
CHANGED
data/task/gemgem.rb
CHANGED
@@ -38,6 +38,99 @@ module Gemgem
|
|
38
38
|
self.spec = spec
|
39
39
|
end
|
40
40
|
|
41
|
+
def gem_install
|
42
|
+
require 'rubygems/commands/install_command'
|
43
|
+
# read ~/.gemrc
|
44
|
+
Gem.use_paths(Gem.configuration[:gemhome], Gem.configuration[:gempath])
|
45
|
+
Gem::Command.extra_args = Gem.configuration[:gem]
|
46
|
+
|
47
|
+
# setup install options
|
48
|
+
cmd = Gem::Commands::InstallCommand.new
|
49
|
+
cmd.handle_options([])
|
50
|
+
|
51
|
+
# install
|
52
|
+
install = Gem::Installer.new(gem_path, cmd.options)
|
53
|
+
install.install
|
54
|
+
puts "\e[35mGem installed: \e[33m#{strip_path(install.gem_dir)}\e[0m"
|
55
|
+
end
|
56
|
+
|
57
|
+
def gem_spec
|
58
|
+
create
|
59
|
+
write
|
60
|
+
end
|
61
|
+
|
62
|
+
def gem_build
|
63
|
+
require 'fileutils'
|
64
|
+
require 'rubygems/package'
|
65
|
+
gem = nil
|
66
|
+
Dir.chdir(dir) do
|
67
|
+
gem = Gem::Package.build(Gem::Specification.load(spec_path))
|
68
|
+
FileUtils.mkdir_p(pkg_dir)
|
69
|
+
FileUtils.mv(gem, pkg_dir) # gem is relative path, but might be ok
|
70
|
+
end
|
71
|
+
puts "\e[35mGem built: \e[33m#{strip_path("#{pkg_dir}/#{gem}")}\e[0m"
|
72
|
+
end
|
73
|
+
|
74
|
+
def gem_release
|
75
|
+
sh_git('tag', gem_tag)
|
76
|
+
sh_git('push')
|
77
|
+
sh_git('push', '--tags')
|
78
|
+
sh_gem('push', gem_path)
|
79
|
+
end
|
80
|
+
|
81
|
+
def gem_check
|
82
|
+
ver = spec.version.to_s
|
83
|
+
|
84
|
+
if ENV['VERSION'].nil?
|
85
|
+
puts("\e[35mExpected " \
|
86
|
+
"\e[33mVERSION\e[35m=\e[33m#{ver}\e[0m")
|
87
|
+
exit(1)
|
88
|
+
|
89
|
+
elsif ENV['VERSION'] != ver
|
90
|
+
puts("\e[35mExpected \e[33mVERSION\e[35m=\e[33m#{ver} " \
|
91
|
+
"\e[35mbut got\n " \
|
92
|
+
"\e[33mVERSION\e[35m=\e[33m#{ENV['VERSION']}\e[0m")
|
93
|
+
exit(2)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
def test
|
98
|
+
return if test_files.empty?
|
99
|
+
|
100
|
+
if ENV['COV'] || ENV['CI']
|
101
|
+
require 'simplecov'
|
102
|
+
if ENV['CI']
|
103
|
+
require 'coveralls'
|
104
|
+
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
|
105
|
+
end
|
106
|
+
SimpleCov.start do
|
107
|
+
add_filter('test/')
|
108
|
+
add_filter('test.rb')
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
test_files.each{ |file| require "#{dir}/#{file[0..-4]}" }
|
113
|
+
end
|
114
|
+
|
115
|
+
def clean
|
116
|
+
return if ignored_files.empty?
|
117
|
+
|
118
|
+
require 'fileutils'
|
119
|
+
trash = File.expand_path("~/.Trash/#{spec.name}")
|
120
|
+
puts "Move the following files into: \e[35m#{strip_path(trash)}\e[33m"
|
121
|
+
|
122
|
+
ignored_files.each do |file|
|
123
|
+
from = "#{dir}/#{file}"
|
124
|
+
to = "#{trash}/#{File.dirname(file)}"
|
125
|
+
puts strip_path(from)
|
126
|
+
|
127
|
+
FileUtils.mkdir_p(to)
|
128
|
+
FileUtils.mv(from, to)
|
129
|
+
end
|
130
|
+
|
131
|
+
print "\e[0m"
|
132
|
+
end
|
133
|
+
|
41
134
|
def write
|
42
135
|
File.open(spec_path, 'w'){ |f| f << split_lines(spec.to_ruby) }
|
43
136
|
end
|
@@ -173,82 +266,38 @@ namespace :gem do
|
|
173
266
|
|
174
267
|
desc 'Install gem'
|
175
268
|
task :install => [:build] do
|
176
|
-
Gemgem.
|
269
|
+
Gemgem.gem_install
|
177
270
|
end
|
178
271
|
|
179
272
|
desc 'Build gem'
|
180
273
|
task :build => [:spec] do
|
181
|
-
|
182
|
-
require 'rubygems/package'
|
183
|
-
gem = nil
|
184
|
-
Dir.chdir(Gemgem.dir) do
|
185
|
-
gem = Gem::Package.build(Gem::Specification.load(Gemgem.spec_path))
|
186
|
-
FileUtils.mkdir_p(Gemgem.pkg_dir)
|
187
|
-
FileUtils.mv(gem, Gemgem.pkg_dir) # gem is relative path, but might be ok
|
188
|
-
end
|
189
|
-
puts "\e[35mGem built: \e[33m" \
|
190
|
-
"#{Gemgem.strip_path("#{Gemgem.pkg_dir}/#{gem}")}\e[0m"
|
274
|
+
Gemgem.gem_build
|
191
275
|
end
|
192
276
|
|
193
277
|
desc 'Generate gemspec'
|
194
278
|
task :spec do
|
195
|
-
Gemgem.
|
196
|
-
Gemgem.write
|
279
|
+
Gemgem.gem_spec
|
197
280
|
end
|
198
281
|
|
199
282
|
desc 'Release gem'
|
200
283
|
task :release => [:spec, :check, :build] do
|
201
|
-
Gemgem.
|
202
|
-
sh_git('tag', Gemgem.gem_tag)
|
203
|
-
sh_git('push')
|
204
|
-
sh_git('push', '--tags')
|
205
|
-
sh_gem('push', Gemgem.gem_path)
|
206
|
-
end
|
284
|
+
Gemgem.gem_release
|
207
285
|
end
|
208
286
|
|
209
287
|
task :check do
|
210
|
-
|
211
|
-
|
212
|
-
if ENV['VERSION'].nil?
|
213
|
-
puts("\e[35mExpected " \
|
214
|
-
"\e[33mVERSION\e[35m=\e[33m#{ver}\e[0m")
|
215
|
-
exit(1)
|
216
|
-
|
217
|
-
elsif ENV['VERSION'] != ver
|
218
|
-
puts("\e[35mExpected \e[33mVERSION\e[35m=\e[33m#{ver} " \
|
219
|
-
"\e[35mbut got\n " \
|
220
|
-
"\e[33mVERSION\e[35m=\e[33m#{ENV['VERSION']}\e[0m")
|
221
|
-
exit(2)
|
222
|
-
end
|
288
|
+
Gemgem.gem_check
|
223
289
|
end
|
224
290
|
|
225
291
|
end # of gem namespace
|
226
292
|
|
227
293
|
desc 'Run tests'
|
228
294
|
task :test do
|
229
|
-
|
230
|
-
Gemgem.test_files.each{ |file| require "#{Gemgem.dir}/#{file[0..-4]}" }
|
295
|
+
Gemgem.test
|
231
296
|
end
|
232
297
|
|
233
298
|
desc 'Trash ignored files'
|
234
299
|
task :clean => ['gem:spec'] do
|
235
|
-
|
236
|
-
|
237
|
-
require 'fileutils'
|
238
|
-
trash = File.expand_path("~/.Trash/#{Gemgem.spec.name}")
|
239
|
-
puts "Move the following files into:" \
|
240
|
-
" \e[35m#{Gemgem.strip_path(trash)}\e[33m"
|
241
|
-
|
242
|
-
Gemgem.ignored_files.each do |file|
|
243
|
-
from = "#{Gemgem.dir}/#{file}"
|
244
|
-
to = "#{trash}/#{File.dirname(file)}"
|
245
|
-
puts Gemgem.strip_path(from)
|
246
|
-
|
247
|
-
FileUtils.mkdir_p(to)
|
248
|
-
FileUtils.mv(from, to)
|
249
|
-
end
|
250
|
-
|
251
|
-
print "\e[0m"
|
300
|
+
Gemgem.clean
|
252
301
|
end
|
253
302
|
|
254
303
|
task :default do
|
data/test/test_swagger.rb
CHANGED
@@ -25,7 +25,7 @@ describe Jellyfish do
|
|
25
25
|
end
|
26
26
|
|
27
27
|
would '/swagger/users' do
|
28
|
-
status,
|
28
|
+
status, _, body = get('/swagger/users', app)
|
29
29
|
status .should.eq 200
|
30
30
|
res = Jellyfish::Json.decode(body.to_a.join)
|
31
31
|
res['basePath'] .should.eq 'https://localhost:8080'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jellyfish
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lin Jen-Shin (godfat)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |-
|
14
14
|
Pico web framework for building API-centric web applications.
|
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
86
86
|
version: '0'
|
87
87
|
requirements: []
|
88
88
|
rubyforge_project:
|
89
|
-
rubygems_version: 2.4.
|
89
|
+
rubygems_version: 2.4.5
|
90
90
|
signing_key:
|
91
91
|
specification_version: 4
|
92
92
|
summary: Pico web framework for building API-centric web applications.
|