transponder 0.0.1 → 0.0.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: 910bf6b26de20271d2a806365fb9918eacf8ca30
4
- data.tar.gz: aa915a656b029f04d20b2f4f2f281e7f7ab2f74c
3
+ metadata.gz: d094cd6ef47d3bc712d1647d17b4b5c68011ff10
4
+ data.tar.gz: 9b13bddf38ff70a3fe0c4f737c49ed70f8a8aebe
5
5
  SHA512:
6
- metadata.gz: 5a63746faa9870c15b830eb5449a4efdb0e6d08bf7257eca8405683c9c22274d36740a82bcf7c85ac5232e5a8f93b0356e266c2e8d4ee4774904316808bcf75c
7
- data.tar.gz: 8e4df1e5e93f02c6bf3d64113d5c21a13590d2020e2e032fde6d34e5e561f63279a3f4e555d332422aa7173495836c1bfe1a61de3148cbc8b7ca02a55f3c5158
6
+ metadata.gz: ce68924a068a7bf1ea96c5c481c3e679e8c593d0e55515d2c4dbfda76c0dc5a75649c96a1adabdc80da5446909748e701b4a4f5c5b4eda9e455e8d5eb1d7865b
7
+ data.tar.gz: d712bb28e15ab17f64d4a3e32bbd0cbaf8e930ee0e04ca8568c3fec8cd0dfea9f748da9a8b3ea8cd88573fb3ef910d90b5bb15a905735519593ca0cc91eb2127
@@ -0,0 +1,11 @@
1
+ #= require transponder/setup
2
+ #= require transponder/error
3
+ #= require transponder/request
4
+ #= require transponder/presenter
5
+ #= require transponder/service
6
+ #= require transponder/init
7
+
8
+
9
+
10
+
11
+
data/lib/transponder.rb CHANGED
@@ -1,5 +1,7 @@
1
- require "transponder/version"
1
+ require 'transponder/version'
2
2
 
3
3
  module Transponder
4
- # Your code goes here...
4
+ module Rails
5
+ require 'transponder/engine'
6
+ end
5
7
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transponder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zack Siri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-24 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2013-05-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: coffee-rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  description: A Cleaner way of working with rails frontend code
14
28
  email:
15
29
  - zack@artellectual.com
@@ -17,23 +31,10 @@ executables: []
17
31
  extensions: []
18
32
  extra_rdoc_files: []
19
33
  files:
20
- - .gitignore
21
- - Gemfile
22
- - LICENSE.txt
23
- - README.md
24
- - Rakefile
34
+ - lib/assets/javascripts/transponder.coffee
25
35
  - lib/transponder.rb
26
- - lib/transponder/engine.rb
27
- - lib/transponder/version.rb
28
- - transponder.gemspec
29
- - vendor/assets/javascripts/.DS_Store
30
- - vendor/assets/javascripts/error.coffee
31
- - vendor/assets/javascripts/init.coffee
32
- - vendor/assets/javascripts/presenter.coffee
33
- - vendor/assets/javascripts/request.coffee
34
- - vendor/assets/javascripts/service.coffee
35
- - vendor/assets/javascripts/setup.coffee
36
- - vendor/assets/javascripts/transponder.coffee
36
+ - README.md
37
+ - LICENSE.txt
37
38
  homepage: http://github.com/zacksiri/transponder
38
39
  licenses: []
39
40
  metadata: {}
data/.gitignore DELETED
@@ -1,17 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in transponder.gemspec
4
- gemspec
data/Rakefile DELETED
@@ -1 +0,0 @@
1
- require "bundler/gem_tasks"
@@ -1,6 +0,0 @@
1
- module Transponder
2
- module Rails
3
- class Engine < ::Rails::Engine
4
- end
5
- end
6
- end
@@ -1,3 +0,0 @@
1
- module Transponder
2
- VERSION = "0.0.1"
3
- end
data/transponder.gemspec DELETED
@@ -1,19 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'transponder/version'
5
-
6
- Gem::Specification.new do |gem|
7
- gem.name = "transponder"
8
- gem.version = Transponder::VERSION
9
- gem.authors = ["Zack Siri"]
10
- gem.email = ["zack@artellectual.com"]
11
- gem.description = %q{A Cleaner way of working with rails frontend code}
12
- gem.summary = %q{This library gives you more control over rails ujs, it compliments turbolinks, and any other library you use. It is opinionated and helps you clean up your client side code in many ways.}
13
- gem.homepage = "http://github.com/zacksiri/transponder"
14
-
15
- gem.files = `git ls-files`.split($/)
16
- gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
- gem.require_paths = ["lib"]
19
- end
Binary file
@@ -1,12 +0,0 @@
1
- class Transponder.Error
2
- response: null
3
-
4
- constructor: ->
5
- doc = $(document)
6
- doc.ajaxError(@handleError)
7
-
8
- handleError: (event, xhr, settings, error) ->
9
- unless xhr.responseText is ""
10
- @response = JSON.parse(xhr.responseText)
11
- eventType = Transponder.buildEvent ['ujs', @response.namespace, @response.controller, @response.action]
12
- $(document).trigger(eventType, @response)
@@ -1,11 +0,0 @@
1
- window.Transponder =
2
- buildEvent: (array) ->
3
- eventType = array.filter (val) -> val != null
4
- eventType.join(':')
5
-
6
- init: ->
7
- Transponder.eh = new Transponder.Error()
8
- Transponder.req = new Transponder.Request()
9
-
10
-
11
- new Transponder.init()
@@ -1,64 +0,0 @@
1
- class Transponder.Presenter
2
- defaultActions: ['new', 'index', 'show', 'update', 'edit', 'create', 'destroy']
3
- params: {}
4
-
5
- presenterName: null
6
- nameSpace: null
7
- modelName: null
8
-
9
- element: null
10
- response: null
11
-
12
- constructor: (options = {}) ->
13
- options.presenterName = @presenterName unless options.presenterName
14
- options.nameSpace = @nameSpace unless options.nameSpace
15
- options.actions = @defaultActions unless options.actions
16
-
17
- doc = $(document)
18
- events = []
19
- for action in options.actions
20
- events.push(Transponder.buildEvent(['ujs', options.nameSpace, options.presenterName, action]))
21
- doc.on(events.join(' '), @runAction)
22
-
23
- elify: (event, response) ->
24
- if @response.errors
25
- if @response.id then "##{@modelName}_#{@response.id}" else "#new_#{@modelName}"
26
- else
27
- "#{event.target.localName}##{event.target.id}"
28
-
29
- beforeFilter: (event, response) ->
30
- @response = response
31
- @element = @elify(event, response)
32
- @params = Transponder.req.objectifyParams()
33
-
34
- runAction: (event, response) =>
35
- @beforeFilter(event, response)
36
- if @response.errors
37
- @errorOut()
38
- else
39
- @[event.type.split(':').pop()]()
40
- @afterFilter(event, response)
41
-
42
- afterFilter: (event, response) ->
43
-
44
-
45
- triggerEmpty: (eventName) ->
46
- console.log "#{eventName} triggered! Override this action in your own controller"
47
-
48
- errorOut: ->
49
- console.log "an error has occured!"
50
-
51
- index: ->
52
- @triggerEmpty('Index')
53
- show: ->
54
- @triggerEmpty('Show')
55
- new: ->
56
- @triggerEmpty('New')
57
- edit: ->
58
- @triggerEmpty('Edit')
59
- update: ->
60
- @triggerEmpty('Update')
61
- create: ->
62
- @triggerEmpty('Create')
63
- destroy: ->
64
- @triggerEmpty('Destroy')
@@ -1,13 +0,0 @@
1
- class Transponder.Request
2
- url: ''
3
-
4
- constructor: ->
5
- $(document).on 'ajax:beforeSend', (event, xhr, settings) =>
6
- @url = ''
7
- @url = settings.url
8
-
9
- objectifyParams: ->
10
- if @url.split('?').length is 2
11
- JSON.parse('{"' + @url.split('?')[1].replace(/&/g, "\",\"").replace(/\=/g,"\":\"") + '"}')
12
- else
13
- {}
File without changes
@@ -1 +0,0 @@
1
- window.Transponder = {}
@@ -1,11 +0,0 @@
1
- #= require setup
2
- #= require error
3
- #= require request
4
- #= require presenter
5
- #= require service
6
- #= require init
7
-
8
-
9
-
10
-
11
-