transponder 1.0.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/assets/javascripts/transponder/service.coffee +5 -11
- data/lib/assets/javascripts/transponder/setup.coffee +14 -1
- data/lib/generators/transponder/install/install_generator.rb +4 -0
- data/lib/generators/transponder/install/templates/{basic/initializers/boot.coffee → basic_boot.coffee} +1 -0
- data/lib/generators/transponder/install/templates/{full/initializers/boot.coffee → full_boot.coffee} +1 -0
- data/lib/generators/transponder/install/templates/minimal_boot.coffee +1 -0
- data/lib/generators/transponder/service/service_generator.rb +0 -8
- data/lib/transponder/version.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44c4428640dfc59dd3da8e81e89064a400ae9c50
|
4
|
+
data.tar.gz: d61643eed437b3f45b56a0dda2aef7050a7ebcc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a1cb5d7726e64a679d496bf1ddafd56727b306931d60b7aae121f403be1bba171755a848fe3e9421d02f5c113cab8af1d99dfb45d17d15249787ea714833c79
|
7
|
+
data.tar.gz: 833c3f18a8763f9959342031292a55c10b61b07d817338db58648c1871c7d421d9d44ab0e7d5b0ffcf0722355525548c204326b3b3b9084a0b1b64c2f4689276
|
@@ -3,17 +3,11 @@ class Transponder.Service
|
|
3
3
|
element: null
|
4
4
|
module: null
|
5
5
|
|
6
|
-
constructor: ->
|
6
|
+
constructor: (element, message = {}) ->
|
7
7
|
throw new Transponder.InvalidService('no service name specified.') unless @serviceName?
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
$(".#{service}:not(#{service}_active)").each (i, f) ->
|
13
|
-
_this.element = $(this)
|
14
|
-
_this.element.addClass("#{service}_active")
|
15
|
-
_this.serve(message)
|
16
|
-
|
17
|
-
|
8
|
+
@element = $(element)
|
9
|
+
@element.addClass("#{this.serviceName}_active")
|
10
|
+
@serve(message)
|
11
|
+
|
18
12
|
serve: ->
|
19
13
|
|
@@ -6,4 +6,17 @@ window.Transponder =
|
|
6
6
|
init: ->
|
7
7
|
Transponder.eh = new Transponder.Error()
|
8
8
|
Transponder.req = new Transponder.Request()
|
9
|
-
Transponder.res = new Transponder.Response()
|
9
|
+
Transponder.res = new Transponder.Response()
|
10
|
+
|
11
|
+
buildServicesFor: (services) ->
|
12
|
+
serviceEvents = []
|
13
|
+
for _, service of services
|
14
|
+
serviceEvents.push("#{service::module}:services:#{service::serviceName}")
|
15
|
+
|
16
|
+
$(document).on serviceEvents.join(' '), (e, message = {}) ->
|
17
|
+
[module, _, service] = e.type.split(':')
|
18
|
+
$(".#{service}:not(#{service}_active)").each (i, f) ->
|
19
|
+
for _, fun of services
|
20
|
+
if fun::serviceName is service and fun::module is module
|
21
|
+
new fun(this, message)
|
22
|
+
|
@@ -14,6 +14,10 @@ module Transponder
|
|
14
14
|
directory "#{options[:type].downcase}", base_path
|
15
15
|
end
|
16
16
|
|
17
|
+
def add_boot
|
18
|
+
template "#{options[:type].downcase}_boot.coffee", base_path('initializers/boot.coffee')
|
19
|
+
end
|
20
|
+
|
17
21
|
def add_setup
|
18
22
|
template "#{options[:type].downcase}_setup.coffee", base_path('initializers/setup.coffee')
|
19
23
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
# services
|
@@ -10,18 +10,10 @@ module Transponder
|
|
10
10
|
template "_service.coffee", service_path
|
11
11
|
end
|
12
12
|
|
13
|
-
|
14
13
|
def service_class_name
|
15
14
|
"#{options[:module_name].camelize}.Services.#{file_name.camelize}"
|
16
15
|
end
|
17
16
|
|
18
|
-
def add_service_to_boot
|
19
|
-
boot_file = File.join(javascripts_path, options[:module_name], 'initializers/boot.coffee')
|
20
|
-
insert_into_file boot_file,
|
21
|
-
"new #{service_class_name}()\n",
|
22
|
-
after: "# services\n"
|
23
|
-
end
|
24
|
-
|
25
17
|
def add_service_to_manifest
|
26
18
|
manifest_file = File.join(javascripts_path, options[:module_name], 'initializers/manifest.coffee')
|
27
19
|
insert_into_file manifest_file,
|
data/lib/transponder/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: transponder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zack Siri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coffee-rails
|
@@ -46,25 +46,26 @@ files:
|
|
46
46
|
- lib/generators/transponder/install/install_generator.rb
|
47
47
|
- lib/generators/transponder/install/templates/application.coffee
|
48
48
|
- lib/generators/transponder/install/templates/basic/helpers/.keep
|
49
|
-
- lib/generators/transponder/install/templates/basic/initializers/boot.coffee
|
50
49
|
- lib/generators/transponder/install/templates/basic/presenters/.keep
|
51
50
|
- lib/generators/transponder/install/templates/basic/services/.keep
|
51
|
+
- lib/generators/transponder/install/templates/basic_boot.coffee
|
52
52
|
- lib/generators/transponder/install/templates/basic_setup.coffee
|
53
53
|
- lib/generators/transponder/install/templates/basic_shared.coffee
|
54
54
|
- lib/generators/transponder/install/templates/full/collections/.keep
|
55
55
|
- lib/generators/transponder/install/templates/full/helpers/.keep
|
56
|
-
- lib/generators/transponder/install/templates/full/initializers/boot.coffee
|
57
56
|
- lib/generators/transponder/install/templates/full/models/.keep
|
58
57
|
- lib/generators/transponder/install/templates/full/presenters/.keep
|
59
58
|
- lib/generators/transponder/install/templates/full/services/.keep
|
60
59
|
- lib/generators/transponder/install/templates/full/templates/.keep
|
61
60
|
- lib/generators/transponder/install/templates/full/views/.keep
|
61
|
+
- lib/generators/transponder/install/templates/full_boot.coffee
|
62
62
|
- lib/generators/transponder/install/templates/full_setup.coffee
|
63
63
|
- lib/generators/transponder/install/templates/full_shared.coffee
|
64
64
|
- lib/generators/transponder/install/templates/manifest.coffee
|
65
65
|
- lib/generators/transponder/install/templates/minimal/helpers/.keep
|
66
66
|
- lib/generators/transponder/install/templates/minimal/initializers/boot.coffee
|
67
67
|
- lib/generators/transponder/install/templates/minimal/services/.keep
|
68
|
+
- lib/generators/transponder/install/templates/minimal_boot.coffee
|
68
69
|
- lib/generators/transponder/install/templates/minimal_setup.coffee
|
69
70
|
- lib/generators/transponder/install/templates/minimal_shared.coffee
|
70
71
|
- lib/generators/transponder/presenter/presenter_generator.rb
|
@@ -114,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
115
|
version: '0'
|
115
116
|
requirements: []
|
116
117
|
rubyforge_project:
|
117
|
-
rubygems_version: 2.
|
118
|
+
rubygems_version: 2.5.1
|
118
119
|
signing_key:
|
119
120
|
specification_version: 4
|
120
121
|
summary: This library gives you more control over rails ujs, it compliments turbolinks,
|