action_channels 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ec1b0643e485c608718ff7be71af50540fedd155
4
- data.tar.gz: 24ae8e570afb08fd0df6163fa816acc034ccda40
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NDczOTM0NGIzOGZiYzJhNDkzNzQ3ZTc4ZDQ1NjU2NDhkZGEzYzFkNQ==
5
+ data.tar.gz: !binary |-
6
+ Yzk0ODhhNzVkMjNlOTkxMWE2ZWFmMDJhNzRmOWVkNDY0MDQyYmIxNw==
5
7
  SHA512:
6
- metadata.gz: 4e5867b4e9eea968ee6a9ae1d4a9f3b721eeabc8818652855bf753c85fa2f2dfbc2141bc4a51c090126b6c4179d3214471191c9a1a9b02bbfbe318eafd131150
7
- data.tar.gz: 6341fe1ceee4897bb0328d6863c27332db32094a70bf64b6c56efd8850d705f0e6571bf34d3054709d436973c8e283070e01fdb4b1fcdf377af915be9324e389
8
+ metadata.gz: !binary |-
9
+ ZDIzODE4ZWVmOTEyOGRhZjJlMzkxMGEzMjQ2YWIxMTZkZjdiNmYxNzMwNjJi
10
+ ZDA3NDk1OTgyMTdkZDI5NmE0YWZmMGM0NWRmZmM1MzkzNTBjOThlMmQyNDU0
11
+ YzgyNjI3ZmQ1MGVmN2MxZTU4OThiMTQ5ZjA3ZGU0NWVjYWM5ZmE=
12
+ data.tar.gz: !binary |-
13
+ ZDMyMDFkZTY3YWNjZGNiNTY4OTIzOWE4NmJiZjZjNjk1NzFiY2M0YTdlMDI1
14
+ OGJhYjUwNzFkMWFiNGY1YzMxMDIyYWViOGRmZjljZjRkYjA5NmQwYTcyMzg4
15
+ MmI3YjdmZTc3NjJmYmMyMjZkM2Q3NGM4YmY0ZDVhZGEyOTYwZDc=
data/.gitignore CHANGED
@@ -8,6 +8,13 @@
8
8
  /tmp/
9
9
  /examples/*.log
10
10
  /examples/tmp/
11
+ Gemfile.lock
11
12
 
12
13
  # rspec failure tracking
13
14
  .rspec_status
15
+
16
+ # ignore the Ruby Version manager
17
+ .rvmrc
18
+ .ruby-version
19
+ .ruby-gemset
20
+ .rbenv
@@ -0,0 +1,10 @@
1
+ language: ruby
2
+
3
+ rvm:
4
+ - 1.9.3
5
+ - 2.4.2
6
+
7
+ bundler_args: --jobs=2 --retry=3
8
+
9
+ script:
10
+ bundle exec rake spec
@@ -21,9 +21,13 @@ Gem::Specification.new do |spec|
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  spec.require_paths = ["lib"]
23
23
 
24
- spec.add_runtime_dependency 'nio4r-websocket'
24
+ if RUBY_VERSION =~ /^1.9/
25
+ spec.add_dependency 'nio4r', '1.2.1'
26
+ end
27
+
28
+ spec.add_dependency 'nio4r-websocket'
25
29
 
26
- spec.add_development_dependency "bundler", "~> 1.16"
30
+ spec.add_development_dependency "bundler", ">= 1.0.0"
27
31
  spec.add_development_dependency "rake", "~> 10.0"
28
32
  spec.add_development_dependency "rspec", "~> 3.0"
29
33
  end
@@ -11,10 +11,10 @@ module ActionChannels
11
11
  attr_reader :name, :clients
12
12
  attr_accessor :message_sender
13
13
 
14
- def initialize(name:, message_sender: MessageSenders::WebSocket.new)
15
- @name = name
14
+ def initialize(attrs)
15
+ @name = attrs.fetch(:name)
16
16
  @clients = Set.new
17
- @message_sender = message_sender
17
+ @message_sender = attrs.fetch :message_sender, MessageSenders::WebSocket.new
18
18
  end
19
19
 
20
20
  def send_message(receiver, message)
@@ -29,11 +29,11 @@ module ActionChannels
29
29
  end
30
30
  end
31
31
 
32
- def initialize(channel:, type:, author: nil, details: {})
33
- @channel = channel
34
- @type = type
35
- @author = author
36
- @details = details
32
+ def initialize(attrs)
33
+ @channel = attrs.fetch(:channel)
34
+ @type = attrs.fetch(:type)
35
+ @author = attrs[:author]
36
+ @details = attrs.fetch :details, {}
37
37
  end
38
38
 
39
39
  def to_raw
@@ -4,8 +4,8 @@ module ActionChannels
4
4
  class Server
5
5
  attr_reader :port
6
6
 
7
- def initialize(port:)
8
- @port = port
7
+ def initialize(options)
8
+ @port = options.fetch(:port)
9
9
  end
10
10
 
11
11
  def run
@@ -1,3 +1,3 @@
1
1
  module ActionChannels
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,69 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_channels
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - German Antsiferov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-02 00:00:00.000000000 Z
11
+ date: 2018-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: nio4r
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 1.2.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 1.2.1
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: nio4r-websocket
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
- - - ">="
31
+ - - ! '>='
18
32
  - !ruby/object:Gem::Version
19
33
  version: '0'
20
34
  type: :runtime
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
- - - ">="
38
+ - - ! '>='
25
39
  - !ruby/object:Gem::Version
26
40
  version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
- - - "~>"
45
+ - - ! '>='
32
46
  - !ruby/object:Gem::Version
33
- version: '1.16'
47
+ version: 1.0.0
34
48
  type: :development
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
- - - "~>"
52
+ - - ! '>='
39
53
  - !ruby/object:Gem::Version
40
- version: '1.16'
54
+ version: 1.0.0
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rake
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - "~>"
59
+ - - ~>
46
60
  - !ruby/object:Gem::Version
47
61
  version: '10.0'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - "~>"
66
+ - - ~>
53
67
  - !ruby/object:Gem::Version
54
68
  version: '10.0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rspec
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - "~>"
73
+ - - ~>
60
74
  - !ruby/object:Gem::Version
61
75
  version: '3.0'
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
- - - "~>"
80
+ - - ~>
67
81
  - !ruby/object:Gem::Version
68
82
  version: '3.0'
69
83
  description: Easy server on websockets.
@@ -73,12 +87,11 @@ executables: []
73
87
  extensions: []
74
88
  extra_rdoc_files: []
75
89
  files:
76
- - ".editorconfig"
77
- - ".gitignore"
78
- - ".rspec"
79
- - ".ruby-version"
90
+ - .editorconfig
91
+ - .gitignore
92
+ - .rspec
93
+ - .travis.yml
80
94
  - Gemfile
81
- - Gemfile.lock
82
95
  - LICENSE.txt
83
96
  - README.md
84
97
  - Rakefile
@@ -104,17 +117,17 @@ require_paths:
104
117
  - lib
105
118
  required_ruby_version: !ruby/object:Gem::Requirement
106
119
  requirements:
107
- - - ">="
120
+ - - ! '>='
108
121
  - !ruby/object:Gem::Version
109
122
  version: '0'
110
123
  required_rubygems_version: !ruby/object:Gem::Requirement
111
124
  requirements:
112
- - - ">="
125
+ - - ! '>='
113
126
  - !ruby/object:Gem::Version
114
127
  version: '0'
115
128
  requirements: []
116
129
  rubyforge_project:
117
- rubygems_version: 2.6.13
130
+ rubygems_version: 2.6.10
118
131
  signing_key:
119
132
  specification_version: 4
120
133
  summary: Easy server on websockets.
@@ -1 +0,0 @@
1
- 2.4.2
@@ -1,43 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- action_channels (0.1.1)
5
- nio4r-websocket
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- diff-lcs (1.3)
11
- nio4r (2.2.0)
12
- nio4r-websocket (0.6.2)
13
- nio4r (>= 1.2.1, < 3.0)
14
- websocket-driver (~> 0.7)
15
- rake (10.5.0)
16
- rspec (3.7.0)
17
- rspec-core (~> 3.7.0)
18
- rspec-expectations (~> 3.7.0)
19
- rspec-mocks (~> 3.7.0)
20
- rspec-core (3.7.1)
21
- rspec-support (~> 3.7.0)
22
- rspec-expectations (3.7.0)
23
- diff-lcs (>= 1.2.0, < 2.0)
24
- rspec-support (~> 3.7.0)
25
- rspec-mocks (3.7.0)
26
- diff-lcs (>= 1.2.0, < 2.0)
27
- rspec-support (~> 3.7.0)
28
- rspec-support (3.7.1)
29
- websocket-driver (0.7.0)
30
- websocket-extensions (>= 0.1.0)
31
- websocket-extensions (0.1.3)
32
-
33
- PLATFORMS
34
- ruby
35
-
36
- DEPENDENCIES
37
- action_channels!
38
- bundler (~> 1.16)
39
- rake (~> 10.0)
40
- rspec (~> 3.0)
41
-
42
- BUNDLED WITH
43
- 1.16.0