entangled 0.0.14 → 0.0.15
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/lib/entangled/routes.rb +65 -0
- data/lib/entangled/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 494cf5b44c0dfd9bcab9e70540e048f5673ece7d
|
4
|
+
data.tar.gz: db4d77e01e589148f03dac03fac802f515bfecfd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39587a9ec99d12235f0bfc1d32d67a360358183cbecf7d6247a935c02ef6fb46624a7fc221f01d759bc40b383383bf26f2fce6fe38f0e93837afe647c7d7e9f3
|
7
|
+
data.tar.gz: cb264b51a9afc3de28478ab4ebb3c5c676e49e2126ed8a4c8dbc845dd3c288fdef89b07bb6448c84867bfcaedb43b86453a3ab227b88f0f50856619cfbc9305f
|
@@ -0,0 +1,65 @@
|
|
1
|
+
module ActionDispatch::Routing
|
2
|
+
class Mapper
|
3
|
+
private
|
4
|
+
def sockets_for(resource, options = {})
|
5
|
+
@resources = resource.to_s.underscore.pluralize.to_sym
|
6
|
+
@resource = resource.to_s.underscore.singularize.to_sym
|
7
|
+
|
8
|
+
if options.any?
|
9
|
+
if options[:only]
|
10
|
+
if options[:only].is_a? Symbol
|
11
|
+
send :"draw_#{options[:only]}"
|
12
|
+
elsif options[:only].is_a? Array
|
13
|
+
options[:only].each do |option|
|
14
|
+
send :"draw_#{option}"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
elsif options[:except]
|
18
|
+
if options[:except].is_a? Symbol
|
19
|
+
(default_options - [options[:except]]).each do |option|
|
20
|
+
send :"draw_#{option}"
|
21
|
+
end
|
22
|
+
elsif options[:except].is_a? Array
|
23
|
+
(default_options - options[:except]).each do |option|
|
24
|
+
send :"draw_#{option}"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
else
|
29
|
+
draw_all
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def default_options
|
34
|
+
[:index, :create, :show, :destroy, :update]
|
35
|
+
end
|
36
|
+
|
37
|
+
def draw_all
|
38
|
+
draw_index
|
39
|
+
draw_create
|
40
|
+
draw_show
|
41
|
+
draw_destroy
|
42
|
+
draw_update
|
43
|
+
end
|
44
|
+
|
45
|
+
def draw_index
|
46
|
+
get :"/#{@resources}", to: "#{@resources}#index", as: @resources
|
47
|
+
end
|
48
|
+
|
49
|
+
def draw_create
|
50
|
+
get :"/#{@resources}/create", to: "#{@resources}#create", as: :"create_#{@resource}"
|
51
|
+
end
|
52
|
+
|
53
|
+
def draw_show
|
54
|
+
get :"/#{@resources}/:id", to: "#{@resources}#show", as: @resource
|
55
|
+
end
|
56
|
+
|
57
|
+
def draw_destroy
|
58
|
+
get :"/#{@resources}/:id/destroy", to: "#{@resources}#destroy", as: :"destroy_#{@resource}"
|
59
|
+
end
|
60
|
+
|
61
|
+
def draw_update
|
62
|
+
get :"/#{@resources}/:id/update", to: "#{@resources}#update", as: :"update_#{@resource}"
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
data/lib/entangled/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: entangled
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dennis Charles Hackethal
|
@@ -170,6 +170,7 @@ files:
|
|
170
170
|
- lib/entangled/controller.rb
|
171
171
|
- lib/entangled/helpers.rb
|
172
172
|
- lib/entangled/model.rb
|
173
|
+
- lib/entangled/routes.rb
|
173
174
|
- lib/entangled/version.rb
|
174
175
|
- spec/dummy/README.rdoc
|
175
176
|
- spec/dummy/Rakefile
|
@@ -9830,7 +9831,6 @@ files:
|
|
9830
9831
|
- spec/dummy/public/test/controllers/messages_test.js
|
9831
9832
|
- spec/dummy/public/views/messages/index.html
|
9832
9833
|
- spec/dummy/public/views/messages/show.html
|
9833
|
-
- spec/dummy/tmp/pids/server.pid
|
9834
9834
|
- spec/models/inclusion_exclusion_spec.rb
|
9835
9835
|
- spec/models/message_spec.rb
|
9836
9836
|
- spec/routing/inclusion_exclusion_routing_spec.rb
|
@@ -19516,7 +19516,6 @@ test_files:
|
|
19516
19516
|
- spec/dummy/public/views/messages/show.html
|
19517
19517
|
- spec/dummy/Rakefile
|
19518
19518
|
- spec/dummy/README.rdoc
|
19519
|
-
- spec/dummy/tmp/pids/server.pid
|
19520
19519
|
- spec/models/inclusion_exclusion_spec.rb
|
19521
19520
|
- spec/models/message_spec.rb
|
19522
19521
|
- spec/routing/inclusion_exclusion_routing_spec.rb
|