event-bus 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/.travis.yml +29 -4
- data/Gemfile +70 -22
- data/Rakefile +44 -20
- data/lib/event/bus.rb +1 -1
- data/lib/event/bus/version.rb +1 -1
- data/lib/event/name_resolver.rb +13 -3
- data/script/bootstrap +20 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49272a921e41a3b24399455d18e27cd8f23cb453
|
4
|
+
data.tar.gz: 0f56f30be1a845251d2a72d3523f1f4c4eba7ded
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3251595d6cdbea5754efb77ce8351f70774ffd3ed332886044132ae6949307d566e5921684730292e39474d1a72c21b43b95083c2039e149af687866e292e7d7
|
7
|
+
data.tar.gz: 83bf7b31c82c8ea5e0b0e0d4080ee52694eb539f949b6da5fe41ec873dc42eb2f6e41c3603932bdcd758da3818963772e5c70dde348186ae93c0a159f5e3b93a
|
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
@@ -1,9 +1,34 @@
|
|
1
1
|
sudo: false
|
2
|
-
env:
|
3
|
-
- CI=1
|
4
2
|
language: ruby
|
5
|
-
|
3
|
+
script: script/test
|
4
|
+
install: script/bootstrap --without development debug
|
6
5
|
rvm:
|
6
|
+
- 1.8.7
|
7
|
+
- 1.9.2
|
8
|
+
- 1.9.3
|
9
|
+
- 2.0.0
|
7
10
|
- 2.1.7
|
8
11
|
- 2.2.3
|
9
|
-
|
12
|
+
- jruby
|
13
|
+
- jruby-20mode
|
14
|
+
- jruby-21mode
|
15
|
+
- jruby-9.0.0.0
|
16
|
+
- jruby-9.0.0.0-20mode
|
17
|
+
- jruby-9.0.0.0-21mode
|
18
|
+
- rbx
|
19
|
+
matrix:
|
20
|
+
allow_failures:
|
21
|
+
- rvm: rbx
|
22
|
+
- rvm: jruby-9.0.0.0
|
23
|
+
- rvm: jruby-9.0.0.0-20mode
|
24
|
+
- rvm: jruby-9.0.0.0-21mode
|
25
|
+
notifications:
|
26
|
+
email:
|
27
|
+
- cukes-devs@googlegroups.com
|
28
|
+
webhooks:
|
29
|
+
urls:
|
30
|
+
- https://webhooks.gitter.im/e/d4d9080e2a8c4910f609
|
31
|
+
env:
|
32
|
+
global:
|
33
|
+
- JRUBY_OPTS='--dev -X-C -Xcli.debug=true --debug
|
34
|
+
- CI=1
|
data/Gemfile
CHANGED
@@ -1,33 +1,81 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
#
|
3
|
+
# Use dependencies from gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
+
# Debug aruba
|
6
7
|
group :debug do
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
if RUBY_VERSION >= '2' && !RUBY_PLATFORM.include?('java')
|
9
|
+
gem 'byebug', '~> 4.0.5'
|
10
|
+
gem 'pry-byebug', '~> 3.1.0'
|
11
|
+
end
|
12
|
+
|
13
|
+
if RUBY_VERSION < '2' && RUBY_VERSION > '1.9' && !RUBY_PLATFORM.include?('java')
|
14
|
+
gem 'debugger', '~> 1.6.8'
|
15
|
+
gem 'pry-debugger', '~> 0.2.3'
|
16
|
+
end
|
17
|
+
|
18
|
+
gem 'pry-doc', '~> 0.8.0'
|
11
19
|
end
|
12
20
|
|
13
21
|
group :development, :test do
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
gem '
|
22
|
-
|
23
|
-
|
24
|
-
gem '
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
22
|
+
# we use this to demonstrate interactive debugging within our feature tests
|
23
|
+
if RUBY_VERSION >= '2'
|
24
|
+
gem 'pry', '~> 0.10.1'
|
25
|
+
else
|
26
|
+
gem 'pry', '~>0.9.12'
|
27
|
+
end
|
28
|
+
|
29
|
+
gem 'aruba', '~>0.11.pre3'
|
30
|
+
|
31
|
+
# Run development tasks
|
32
|
+
gem 'rake', '~> 10.4.2'
|
33
|
+
|
34
|
+
if RUBY_VERSION >= '2.0.0'
|
35
|
+
# Lint travis yaml
|
36
|
+
gem 'travis-yaml'
|
37
|
+
|
38
|
+
# Reporting
|
39
|
+
gem 'bcat', '~> 0.6.2'
|
40
|
+
gem 'kramdown', '~> 1.7.0'
|
41
|
+
end
|
42
|
+
|
43
|
+
# Code Coverage
|
44
|
+
gem 'simplecov', '~> 0.10'
|
45
|
+
|
46
|
+
# Test api
|
47
|
+
gem 'rspec', '~> 3.4'
|
48
|
+
gem 'fuubar', '~> 2.0.0'
|
49
|
+
|
50
|
+
# using platform for this make bundler complain about the same gem given
|
51
|
+
# twice
|
52
|
+
if RUBY_VERSION < '1.9.3'
|
53
|
+
gem 'cucumber', '~> 1.3.20'
|
54
|
+
else
|
55
|
+
gem 'cucumber', '~> 2.0'
|
56
|
+
end
|
57
|
+
|
58
|
+
if RUBY_VERSION >= '1.9.3'
|
59
|
+
# Make aruba compliant to ruby community guide
|
60
|
+
gem 'rubocop', '~> 0.32.0'
|
61
|
+
end
|
62
|
+
|
63
|
+
gem 'cucumber-pro', '~> 0.0' if RUBY_VERSION >= '1.9.3'
|
64
|
+
|
65
|
+
if RUBY_VERSION >= '1.9.3'
|
66
|
+
# License compliance
|
67
|
+
gem 'license_finder', '~> 2.0.4'
|
68
|
+
end
|
69
|
+
|
70
|
+
if RUBY_VERSION >= '1.9.3'
|
71
|
+
# Upload documentation
|
72
|
+
gem 'relish', '~> 0.7.1'
|
73
|
+
end
|
74
|
+
|
75
|
+
gem 'minitest', '~> 5.8.0'
|
29
76
|
end
|
30
77
|
|
31
|
-
|
32
|
-
gem '
|
78
|
+
platforms :rbx do
|
79
|
+
gem 'rubysl', '~> 2.0'
|
80
|
+
gem 'rubinius-developer_tools'
|
33
81
|
end
|
data/Rakefile
CHANGED
@@ -1,34 +1,58 @@
|
|
1
1
|
#!/usr/bin/env rake
|
2
|
+
#
|
3
|
+
require 'bundler'
|
4
|
+
Bundler.setup
|
2
5
|
|
3
6
|
namespace :gem do
|
4
7
|
require 'bundler/gem_tasks'
|
5
8
|
end
|
6
9
|
|
7
|
-
|
8
|
-
task default: :test
|
10
|
+
require 'cucumber/rake/task'
|
9
11
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
Cucumber::Rake::Task.new do |t|
|
13
|
+
t.cucumber_opts = ''
|
14
|
+
# t.cucumber_opts = "--format Cucumber::Pro --out cucumber-pro.log" if ENV['CUCUMBER_PRO_TOKEN']
|
15
|
+
t.cucumber_opts << '--format pretty'
|
16
|
+
end
|
15
17
|
|
16
|
-
|
17
|
-
|
18
|
-
|
18
|
+
Cucumber::Rake::Task.new(:cucumber_wip) do |t|
|
19
|
+
t.cucumber_opts = '-p wip'
|
20
|
+
end
|
19
21
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
22
|
+
require 'rspec/core/rake_task'
|
23
|
+
desc 'Run RSpec'
|
24
|
+
RSpec::Core::RakeTask.new do |spec|
|
25
|
+
spec.rspec_opts = ['--color', '--format documentation']
|
26
|
+
end
|
24
27
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
+
namespace :travis do
|
29
|
+
desc 'Lint travis.yml'
|
30
|
+
task :lint do
|
31
|
+
begin
|
32
|
+
require 'travis/yaml'
|
33
|
+
|
34
|
+
puts 'Linting .travis.yml ... No output is good!'
|
35
|
+
Travis::Yaml.parse! File.read('.travis.yml')
|
36
|
+
rescue LoadError
|
37
|
+
$stderr.puts 'You ruby is not supported for linting the .travis.yml'
|
38
|
+
end
|
28
39
|
end
|
40
|
+
end
|
29
41
|
|
30
|
-
|
31
|
-
|
32
|
-
|
42
|
+
if RUBY_VERSION < '1.9.3'
|
43
|
+
begin
|
44
|
+
require 'rubocop/rake_task'
|
45
|
+
RuboCop::RakeTask.new
|
46
|
+
rescue LoadError
|
47
|
+
desc 'Stub task to make rake happy'
|
48
|
+
task(:rubocop) {}
|
33
49
|
end
|
50
|
+
else
|
51
|
+
require 'rubocop/rake_task'
|
52
|
+
RuboCop::RakeTask.new
|
34
53
|
end
|
54
|
+
|
55
|
+
desc 'Run tests, both RSpec and Cucumber'
|
56
|
+
task :test => ['travis:lint', :rubocop, :spec, :cucumber, :cucumber_wip]
|
57
|
+
|
58
|
+
task :default => :test
|
data/lib/event/bus.rb
CHANGED
data/lib/event/bus/version.rb
CHANGED
data/lib/event/name_resolver.rb
CHANGED
@@ -18,13 +18,17 @@ module Event
|
|
18
18
|
constantize("#{@default_namespace}::#{camel_case(event_id)}")
|
19
19
|
end
|
20
20
|
rescue => e
|
21
|
-
raise EventNameResolveError, %(Transforming "#{event_id}" into an event class failed: #{e.message}.)
|
21
|
+
raise EventNameResolveError, %(Transforming "#{event_id}" into an event class failed: #{e.message}.\n\n#{e.backtrace.join("\n")})
|
22
22
|
end
|
23
23
|
|
24
24
|
private
|
25
25
|
|
26
26
|
def camel_case(underscored_name)
|
27
|
-
|
27
|
+
if RUBY_VERSION < '1.9.3'
|
28
|
+
underscored_name.to_s.split('_').map { |word| word.upcase.chars.to_a[0] + word.chars.to_a[1..-1].join }.join
|
29
|
+
else
|
30
|
+
underscored_name.to_s.split('_').map { |word| word.upcase[0] + word[1..-1] }.join
|
31
|
+
end
|
28
32
|
end
|
29
33
|
|
30
34
|
# Thanks ActiveSupport
|
@@ -43,7 +47,13 @@ module Event
|
|
43
47
|
constant.const_get(name)
|
44
48
|
else
|
45
49
|
candidate = constant.const_get(name)
|
46
|
-
|
50
|
+
|
51
|
+
if RUBY_VERSION < '1.9.3'
|
52
|
+
next candidate if constant.const_defined?(name)
|
53
|
+
else
|
54
|
+
next candidate if constant.const_defined?(name, false)
|
55
|
+
end
|
56
|
+
|
47
57
|
next candidate unless Object.const_defined?(name)
|
48
58
|
|
49
59
|
# Go down the ancestors to check if it is owned directly. The check
|
data/script/bootstrap
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
set -e
|
4
|
+
|
5
|
+
info_msg="\e[0;32m[INFO]\e[0;30m"
|
6
|
+
error_msg="\e[0;31mFAILED\e[0;30m"
|
7
|
+
|
8
|
+
function output_error_log {
|
9
|
+
[[ -f error.log ]] && ( cat error.log >&2; rm error.log)
|
10
|
+
}
|
11
|
+
|
12
|
+
echo -ne "$info_msg Checking if ruby installed? "
|
13
|
+
which 'ruby' >/dev/null 2>error.log || ( echo -e "$error_msg\n\nCould not find \`ruby\`. Please install ruby or add it to PATH"; output_error_log; exit 1 )
|
14
|
+
echo OK
|
15
|
+
|
16
|
+
echo -e "$info_msg rubygem \"bundler\" "
|
17
|
+
gem install bundler
|
18
|
+
|
19
|
+
echo -e "$info_msg \"bundle install\" "
|
20
|
+
bundle install $*
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: event-bus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dennis Günnewig
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -56,6 +56,7 @@ files:
|
|
56
56
|
- lib/event/bus/version.rb
|
57
57
|
- lib/event/errors.rb
|
58
58
|
- lib/event/name_resolver.rb
|
59
|
+
- script/bootstrap
|
59
60
|
- script/console
|
60
61
|
- script/setup
|
61
62
|
- script/test
|