m2config 0.5.3 → 0.5.4

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: 8ff07c47abc8681428c309b6f7149d88bdfeab2f
4
- data.tar.gz: 406ebf7f14b7d323cac91cc6b89601969c7bac7e
3
+ metadata.gz: 1686b2f58b1d2458e9db47c9e88af841b0b15332
4
+ data.tar.gz: 7c44815043517753897c2e1a680b9a1956d09990
5
5
  SHA512:
6
- metadata.gz: 5c71a0cd31e62607ee4de5f8d786c989b916433dea9b4ecc65b4e38e26e31f65cbcfe65b31e9a2f4e9479c66c911244b8fe3af692a163cc0d1e816fe41d547cf
7
- data.tar.gz: a8f4be0037c8a953495530eb57bca1dc0aa3300ebdf2b8b881d00683423a86f1f41bcc2755a9dda9c16eda60d3f73cc1fc2cf2ad677c92eddf9c1d23c3e2aa05
6
+ metadata.gz: 3047f3a13d345585396c5181044f560090fa6bfe7990c806df72a80cdfb1b88241e60012b35d07f96131ddeefa58ced9d7bbd754d192d209e65b1fa998f5a38a
7
+ data.tar.gz: a2a09aefbb0c124c40182ab9602171e89f386f87d24770fba2a48835ea3442c447afb7657950b6a0b9aca12e04e9a90ab662948b3214a7f6e4b2c8fb2656894b
@@ -2,14 +2,9 @@ module M2Config
2
2
  class Handler < Sequel::Model(:handler)
3
3
  plugin :validation_helpers
4
4
 
5
- ID_REGEX = /^[-a-zA-Z0-9]+$/
6
-
7
5
  def initialize( fields )
8
6
  raise ArgumentError, "The send and receive endpoints can not be the same" if
9
7
  fields[:send_spec] == fields[:recv_spec]
10
- raise ArgumentError, "Handler send and recv IDs must only use -a-zA-Z0-9" if
11
- !(fields[:send_ident] =~ ID_REGEX &&
12
- fields[:send_ident] =~ ID_REGEX)
13
8
  fields[:recv_ident] ||= ""
14
9
  super(fields, false)
15
10
  save
@@ -853,4 +853,6 @@
853
853
  '.webm': 'video/webm'
854
854
  '.ogv': 'video/ogg'
855
855
  '.oga': 'audio/ogg'
856
+ '.cmd': 'application/x-msdownload'
857
+
856
858
 
@@ -1,3 +1,3 @@
1
1
  module M2Config
2
- VERSION = "0.5.3"
2
+ VERSION = "0.5.4"
3
3
  end
data/spec/handler_spec.rb CHANGED
@@ -7,43 +7,34 @@ describe M2Config::Handler do
7
7
  it "needs the ØMQ addresses and a send identifier" do
8
8
  M2Config::Handler.new({ send_spec:"tcp://10.0.0.1:8989",
9
9
  recv_spec:"tcp://10.0.0.1:9898",
10
- send_ident: "dev-example-comID"})
10
+ send_ident: "dev.example.com ID"})
11
11
  res = CFG.db[:handler].first
12
12
  res[:send_spec].should eq("tcp://10.0.0.1:8989")
13
13
  res[:recv_spec].should eq("tcp://10.0.0.1:9898")
14
- res[:send_ident].should eq("dev-example-comID")
14
+ res[:send_ident].should eq("dev.example.com ID")
15
15
  end
16
16
 
17
17
  it "turns nil into empty string when recv_ident is not set" do
18
18
  M2Config::Handler.new({ send_spec:"tcp://10.0.0.1:8989",
19
19
  recv_spec:"tcp://10.0.0.1:9898",
20
- send_ident: "dev-example-comID"})
20
+ send_ident: "dev.example.com ID"})
21
21
  res = CFG.db[:handler].first
22
22
  res[:recv_ident].should be_empty
23
23
  end
24
24
 
25
- describe "helps you spot common mistakes:" do
25
+ describe "helps you spot common mistakes" do
26
26
  it "yells when the addresses are the same" do
27
27
  expect do
28
28
  M2Config::Handler.new({send_spec:"tcp://10.0.0.1:8989", recv_spec:"tcp://10.0.0.1:8989", send_ident: "dev.example.com ID"})
29
29
  end.to raise_exception(ArgumentError, /send and receive endpoints can not be the same/i)
30
30
  end
31
31
 
32
- it "yells when the send ID does not respect Mongrel2's constraints (UUID = (alpha | digit | '-')+ )" do
33
- expect do
34
- M2Config::Handler.new({send_spec:"tcp://10.0.0.1:8988", recv_spec:"tcp://10.0.0.1:8989", send_ident: "dev.example.com ID"})
35
- end.to raise_exception(ArgumentError, /Handler send and recv IDs must only use -a-zA-Z0-9/i)
36
- expect do
37
- M2Config::Handler.new({send_spec:"tcp://10.0.0.1:8988", recv_spec:"tcp://10.0.0.1:8989", recv_ident: "dev.example.com ID"})
38
- end.to raise_exception(ArgumentError, /Handler send and recv IDs must only use -a-zA-Z0-9/i)
39
- end
40
-
41
32
  end
42
33
  end
43
34
 
44
35
  describe '#type' do
45
36
  it 'returns its type' do
46
- M2Config::Handler.new({send_spec:"tcp://10.0.0.1:8988", recv_spec:"tcp://10.0.0.1:8989", send_ident: "dev-example-comID"}).type.should eq("handler")
37
+ M2Config::Handler.new({send_spec:"tcp://10.0.0.1:8988", recv_spec:"tcp://10.0.0.1:8989", send_ident: "dev.example.com ID"}).type.should eq("handler")
47
38
  end
48
39
  end
49
40
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: m2config
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arnaud Meuret
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-03 00:00:00.000000000 Z
11
+ date: 2014-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sqlite3
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
152
  version: '0'
153
153
  requirements: []
154
154
  rubyforge_project:
155
- rubygems_version: 2.0.3
155
+ rubygems_version: 2.1.11
156
156
  signing_key:
157
157
  specification_version: 4
158
158
  summary: Manage your Mongrel2 configuration database using handy model classes that