namba 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.DS_Store +0 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +3 -1
- data/README.md +11 -2
- data/lib/.DS_Store +0 -0
- data/lib/namba.rb +9 -0
- data/lib/namba/.DS_Store +0 -0
- data/lib/namba/client.rb +1 -1
- data/lib/namba/engine.rb +4 -0
- data/lib/namba/helpers/action_view_extension.rb +14 -0
- data/lib/namba/hooks.rb +9 -0
- data/lib/namba/railtie.rb +7 -0
- data/lib/namba/version.rb +1 -1
- metadata +9 -2
data/.DS_Store
ADDED
Binary file
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
namba (1.0.
|
4
|
+
namba (1.0.1)
|
5
5
|
multi_json
|
6
6
|
|
7
7
|
GEM
|
@@ -11,6 +11,7 @@ GEM
|
|
11
11
|
crack (0.3.1)
|
12
12
|
diff-lcs (1.1.3)
|
13
13
|
ffi (1.0.11)
|
14
|
+
growl (1.0.3)
|
14
15
|
guard (1.1.1)
|
15
16
|
listen (>= 0.4.2)
|
16
17
|
thor (>= 0.14.6)
|
@@ -52,6 +53,7 @@ PLATFORMS
|
|
52
53
|
ruby
|
53
54
|
|
54
55
|
DEPENDENCIES
|
56
|
+
growl
|
55
57
|
guard
|
56
58
|
guard-bundler
|
57
59
|
guard-rspec
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[![Build Status](https://secure.travis-ci.org/ZeroOneStudio/namba.png)](http://travis-ci.org/ZeroOneStudio/namba)
|
4
4
|
|
5
|
-
A Ruby wrapper for the Namba API. The full API description is available [here][]
|
5
|
+
A Ruby wrapper for the Namba API. The full API description is available [here][].
|
6
6
|
|
7
7
|
[here]: http://dev.namba.kg/api_description.php
|
8
8
|
|
@@ -28,6 +28,8 @@ Or put to your `Gemfile`
|
|
28
28
|
|
29
29
|
Use `:kz` locale if you want to access [namba.kz][] API. Default value is `:kg`
|
30
30
|
|
31
|
+
[namba.kz]: http://www.namba.kz
|
32
|
+
|
31
33
|
## Methods spread on all Namba API
|
32
34
|
|
33
35
|
n.get_user_info(name) # returns specific user information
|
@@ -50,7 +52,14 @@ Leave `name` parameter blank to get information about configured user. Eg.:
|
|
50
52
|
n.get_new_mail_count # returns count of unread messages
|
51
53
|
n.get_last_mail # returns list of inbox messages ordered by creation date. 20 messages is maximum
|
52
54
|
|
53
|
-
[
|
55
|
+
## [Namba Comments][] Rails helper
|
56
|
+
|
57
|
+
If you use namba gem with Rails you can easily create a comment widget. For example, in your *.erb template:
|
58
|
+
|
59
|
+
<%= namba_comments("tamasha", 4850) %> # where "tamasha" -- component_name, "4850" -- component_id (read more in Namba API docs)
|
60
|
+
|
61
|
+
[Namba Comments]: http://dev.namba.kg/api_comments.php
|
62
|
+
|
54
63
|
## Licence
|
55
64
|
|
56
65
|
MIT License Copyright (c) 2012 ZERO.ONE
|
data/lib/.DS_Store
ADDED
Binary file
|
data/lib/namba.rb
CHANGED
data/lib/namba/.DS_Store
ADDED
Binary file
|
data/lib/namba/client.rb
CHANGED
data/lib/namba/engine.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
module Namba
|
2
|
+
module ActionViewExtension
|
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
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
data/lib/namba/hooks.rb
ADDED
data/lib/namba/version.rb
CHANGED
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.0
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-06-
|
13
|
+
date: 2012-06-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: multi_json
|
@@ -100,6 +100,7 @@ executables: []
|
|
100
100
|
extensions: []
|
101
101
|
extra_rdoc_files: []
|
102
102
|
files:
|
103
|
+
- .DS_Store
|
103
104
|
- .gitignore
|
104
105
|
- .rspec
|
105
106
|
- .travis.yml
|
@@ -109,11 +110,17 @@ files:
|
|
109
110
|
- LICENSE
|
110
111
|
- README.md
|
111
112
|
- Rakefile
|
113
|
+
- lib/.DS_Store
|
112
114
|
- lib/namba.rb
|
115
|
+
- lib/namba/.DS_Store
|
113
116
|
- lib/namba/api_methods.rb
|
114
117
|
- lib/namba/client.rb
|
115
118
|
- lib/namba/config.rb
|
119
|
+
- lib/namba/engine.rb
|
116
120
|
- lib/namba/error.rb
|
121
|
+
- lib/namba/helpers/action_view_extension.rb
|
122
|
+
- lib/namba/hooks.rb
|
123
|
+
- lib/namba/railtie.rb
|
117
124
|
- lib/namba/version.rb
|
118
125
|
- namba.gemspec
|
119
126
|
- spec/namba/namba_spec.rb
|