SrBuj 0.9.0alpha1 → 0.9.0alpha2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OGExNzBmYjcyZjhjYjM0ZjRjNjBlMTVmZWU1MGZhOWMwY2ZkOTlhYw==
4
+ MTQ4MTJlMGFjYWRiMTdiZGY1NDU1NWZiZTY2NGY4ZDI4NTk1NzY0MA==
5
5
  data.tar.gz: !binary |-
6
- YzM5YzcyN2NhMzg0NWUzZjc1ODBhMGMzMjk1NzRiODc3NTFhZGFhOA==
6
+ ZmEyNzk3YWM4N2NhY2E3YWJmMDdjZjNmMjNiYmQxZjdhMmY0OTNmMw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- OTg4ZTgzYzE1YjQ0MmM3NjRhOTk2YzE2ZGE2MjY3ZTFjMjg4Yjc4YjMzNTA5
10
- NDRiMTdhMTM0MmVjMGJkNzUwYmMzMWFlMTEwNjc5YjQ3ZjY0MGE0YWMxMjE0
11
- YzdiMjIzOTJkZGUwZWE0YWJhMWNhOTVhM2RmNGRlZTVhZjM0YjY=
9
+ NTcxZmI5MDUyOGZkYjNmYmI0MTBlOGY1ZTI5NWYwNGIwMWY5OGQ1ZTVmNzQ2
10
+ ODBiY2I1NzkwMmRhNGFkMjNmZjg5ZGVkMGYyYzU1YTg5MDJlOTdkMDQ2NWM1
11
+ ZjY2MDZhM2Q2NTZhZDE4OWVlMWFjMDhhMTc2YzFjYjIxN2MxNDI=
12
12
  data.tar.gz: !binary |-
13
- ZTVjZWNjNjU1MWQ2MWMyZmEwMmFlYTk4ZDI4ZmFkYWQ2ODk4MWNiZmYyZDRl
14
- NjRmODlmMmIzZWY4YjhmZjU3MjVlNDRiMDhmMDE0MjIxZTlhMTA1YTI5MTg5
15
- YTJmMjg5NTUxYTUxMzIwODI1OGUxNDIyOTA3YjQwNzdhMTU1MmQ=
13
+ MDg3NWY3YmQxNjJhMmJmY2I2OTBjMDJhZTVkZmQzY2U4ZTEyYmYwMDFlOGIz
14
+ NzA5NDZhNWJmYzIxYzE1NTg4NzU1ZWMxNWVkYWU5Y2Q3YzkzODM3NzU1ODkz
15
+ MTg1YWNlY2NjODI0ODYzNzhmZjc4ZTNkZDI5MThhZDViYWYyNzE=
@@ -1,7 +1,12 @@
1
1
  module SrBuj
2
2
  module ActionController
3
3
  module Helpers
4
-
4
+ HEADERS = { message: 'X-SRBUJ-MSG',
5
+ type: 'X-SRBUJ-TYPE',
6
+ side: 'X-SRBUJ-SIDE',
7
+ position: 'X-SRBUJ-POS',
8
+ time: 'X-SRBUJ-TIME'
9
+ }
5
10
  #=> helpfull method to return redirect_to in an js way.
6
11
  # use: js_redirect(to: root_path)
7
12
  # use: js_redirect(reload: true)
@@ -24,11 +29,9 @@ module SrBuj
24
29
  # use: js_notify (message: 'this is madness!', type: 'error', side: 'right', position: 'top', time: 2000 )
25
30
  def js_notify(options = {})
26
31
  if options[:message]
27
- response.headers['X-SRBUJ-MSG'] = options[:message].to_s
28
- response.headers['X-SRBUJ-TYPE'] = options[:type].to_s if options[:type]
29
- response.headers['X-SRBUJ-SIDE'] = options[:side].to_s if options[:side]
30
- response.headers['X-SRBUJ-POS'] = options[:position].to_s if options[:position]
31
- response.headers['X-SRBUJ-TIME'] = options[:time].to_s if options[:time]
32
+ HEADERS.each do |value, header|
33
+ response.headers[header] = options[value].to_s if options[value]
34
+ end
32
35
  end
33
36
  end
34
37
  end
data/lib/SrBuj/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module SrBuj
2
- VERSION = '0.9.0alpha1'
2
+ VERSION = '0.9.0alpha2'
3
3
  end
@@ -19,7 +19,7 @@
19
19
  };
20
20
  var SrBuj;
21
21
  $.SrBuj = SrBuj = {
22
- version: '0.9.0alpha1',
22
+ version: '0.9.0alpha2',
23
23
  selector: '[data-remote][data-target]',
24
24
  notifyHeaders: { message: 'X-SRBUJ-MSG', type: 'X-SRBUJ-TYPE', side: 'X-SRBUJ-SIDE', position: 'X-SRBUJ-POS', time: 'X-SRBUJ-TIME' },
25
25
  defaults: {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: SrBuj
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0alpha1
4
+ version: 0.9.0alpha2
5
5
  platform: ruby
6
6
  authors:
7
7
  - gagoar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-08 00:00:00.000000000 Z
11
+ date: 2013-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler