namba 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -11,6 +11,7 @@ spec/reports
11
11
  test/tmp
12
12
  test/version_tmp
13
13
  tmp
14
+ .DS_Store
14
15
 
15
16
  # YARD artifacts
16
17
  .yardoc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- namba (1.0.1)
4
+ namba (1.1.0)
5
5
  multi_json
6
6
 
7
7
  GEM
data/Guardfile CHANGED
@@ -1,4 +1,4 @@
1
- guard 'rspec', :version => 2 do
1
+ guard 'rspec', :version => 2, :cli => "--color --format nested --fail-fast --drb" do
2
2
  watch(%r{^spec/.+_spec\.rb$})
3
3
  watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
4
4
  watch('spec/spec_helper.rb') { "spec" }
data/README.md CHANGED
@@ -52,13 +52,29 @@ Leave `name` parameter blank to get information about configured user. Eg.:
52
52
  n.get_new_mail_count # returns count of unread messages
53
53
  n.get_last_mail # returns list of inbox messages ordered by creation date. 20 messages is maximum
54
54
 
55
- ## [Namba Comments][] Rails helper
55
+ ## Namba gem's Rails helpers
56
56
 
57
- If you use namba gem with Rails you can easily create a comment widget. For example, in your *.erb template:
57
+ If you are using `namba` gem in your Rails app you can use some helpers in your *.erb template:
58
58
 
59
- <%= namba_comments("tamasha", 4850) %> # where "tamasha" -- component_name, "4850" -- component_id (read more in Namba API docs)
59
+ ### namba_comments
60
60
 
61
- [Namba Comments]: http://dev.namba.kg/api_comments.php
61
+ <%= namba_comments(component_name, component_id) %>
62
+
63
+ Eg.:
64
+
65
+ <%= namba_comments("tamasha", 4850) %>
66
+
67
+ ### namba_share
68
+
69
+ <%= namba_share(component_name, component_id) %>
70
+
71
+ Eg.:
72
+
73
+ <%= namba_share("kyrnet", 1) %>
74
+
75
+ About `component_name` and `component_id` read more at [Namba Comments docs][]
76
+
77
+ [Namba Comments docs]: http://dev.namba.kg/api_comments.php
62
78
 
63
79
  ## Licence
64
80
 
@@ -1,13 +1,14 @@
1
1
  module Namba
2
2
  module ActionViewExtension
3
3
 
4
- def namba_comments(component_name, component_id)
5
- html = []
6
- html << content_tag(:div, "", :id => "namba-comments")
7
- # html << javascript_include_tag("http://api.namba.#{Namba::Config.options[:locale]}/nb.js.php")
8
- html << javascript_include_tag("http://api.namba.kg/nb.js.php")
9
- html << javascript_tag("NB.insert(\"comments\", \"namba-comments\", {component: \"#{component_name}\", componentId: #{component_id}});")
10
- html.join("\n").html_safe
4
+ %w(comments share).map do |key|
5
+ define_method(:"namba_#{key}") do |component_name, component_id|
6
+ html = []
7
+ html << content_tag(:div, "", :id => "namba-#{key}")
8
+ html << javascript_include_tag("http://api.namba.kg/nb.js.php")
9
+ html << javascript_tag("NB.insert(\"#{key}\", \"namba-#{key}\", {component: \"#{component_name}\", componentId: #{component_id}});")
10
+ html.join("\n").html_safe
11
+ end
11
12
  end
12
13
 
13
14
  end
data/lib/namba/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Namba
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+
4
+ describe Namba::ActionViewExtension do
5
+
6
+ it "should have :namba_comments and :namba_share methods" do
7
+ instance_methods = Namba::ActionViewExtension.instance_methods
8
+ instance_methods.should == [:namba_comments, :namba_share]
9
+ end
10
+
11
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: namba
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-06-24 00:00:00.000000000 Z
13
+ date: 2012-10-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: multi_json
17
- requirement: !ruby/object:Gem::Requirement
17
+ requirement: &80940780 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,15 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
- requirements:
28
- - - ! '>='
29
- - !ruby/object:Gem::Version
30
- version: '0'
25
+ version_requirements: *80940780
31
26
  - !ruby/object:Gem::Dependency
32
27
  name: rspec
33
- requirement: !ruby/object:Gem::Requirement
28
+ requirement: &80940510 !ruby/object:Gem::Requirement
34
29
  none: false
35
30
  requirements:
36
31
  - - ~>
@@ -38,15 +33,10 @@ dependencies:
38
33
  version: 2.7.0
39
34
  type: :development
40
35
  prerelease: false
41
- version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
- requirements:
44
- - - ~>
45
- - !ruby/object:Gem::Version
46
- version: 2.7.0
36
+ version_requirements: *80940510
47
37
  - !ruby/object:Gem::Dependency
48
38
  name: rake
49
- requirement: !ruby/object:Gem::Requirement
39
+ requirement: &80940240 !ruby/object:Gem::Requirement
50
40
  none: false
51
41
  requirements:
52
42
  - - ! '>='
@@ -54,15 +44,10 @@ dependencies:
54
44
  version: '0'
55
45
  type: :development
56
46
  prerelease: false
57
- version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
- requirements:
60
- - - ! '>='
61
- - !ruby/object:Gem::Version
62
- version: '0'
47
+ version_requirements: *80940240
63
48
  - !ruby/object:Gem::Dependency
64
49
  name: webmock
65
- requirement: !ruby/object:Gem::Requirement
50
+ requirement: &80939920 !ruby/object:Gem::Requirement
66
51
  none: false
67
52
  requirements:
68
53
  - - ! '>='
@@ -70,15 +55,10 @@ dependencies:
70
55
  version: '0'
71
56
  type: :development
72
57
  prerelease: false
73
- version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
- requirements:
76
- - - ! '>='
77
- - !ruby/object:Gem::Version
78
- version: '0'
58
+ version_requirements: *80939920
79
59
  - !ruby/object:Gem::Dependency
80
60
  name: rack-test
81
- requirement: !ruby/object:Gem::Requirement
61
+ requirement: &80939630 !ruby/object:Gem::Requirement
82
62
  none: false
83
63
  requirements:
84
64
  - - ! '>='
@@ -86,12 +66,7 @@ dependencies:
86
66
  version: '0'
87
67
  type: :development
88
68
  prerelease: false
89
- version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
- requirements:
92
- - - ! '>='
93
- - !ruby/object:Gem::Version
94
- version: '0'
69
+ version_requirements: *80939630
95
70
  description: Ruby wrapper for Namba API
96
71
  email:
97
72
  - sergey.kishenin@gmail.com
@@ -100,7 +75,6 @@ executables: []
100
75
  extensions: []
101
76
  extra_rdoc_files: []
102
77
  files:
103
- - .DS_Store
104
78
  - .gitignore
105
79
  - .rspec
106
80
  - .travis.yml
@@ -110,9 +84,7 @@ files:
110
84
  - LICENSE
111
85
  - README.md
112
86
  - Rakefile
113
- - lib/.DS_Store
114
87
  - lib/namba.rb
115
- - lib/namba/.DS_Store
116
88
  - lib/namba/api_methods.rb
117
89
  - lib/namba/client.rb
118
90
  - lib/namba/config.rb
@@ -123,6 +95,7 @@ files:
123
95
  - lib/namba/railtie.rb
124
96
  - lib/namba/version.rb
125
97
  - namba.gemspec
98
+ - spec/namba/action_view_extension_spec.rb
126
99
  - spec/namba/namba_spec.rb
127
100
  - spec/spec_helper.rb
128
101
  homepage: https://github.com/ZeroOneStudio/namba
@@ -145,11 +118,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
118
  version: '0'
146
119
  requirements: []
147
120
  rubyforge_project:
148
- rubygems_version: 1.8.24
121
+ rubygems_version: 1.8.10
149
122
  signing_key:
150
123
  specification_version: 3
151
124
  summary: Ruby wrapper for Namba API
152
125
  test_files:
126
+ - spec/namba/action_view_extension_spec.rb
153
127
  - spec/namba/namba_spec.rb
154
128
  - spec/spec_helper.rb
155
129
  has_rdoc:
data/.DS_Store DELETED
Binary file
data/lib/.DS_Store DELETED
Binary file
data/lib/namba/.DS_Store DELETED
Binary file