jsb_client 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/jsb.rb +17 -13
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8cc634a4142a3bd3aad582aae2572fad872e75f
|
4
|
+
data.tar.gz: 674e012b2c034bbf8695582d10081ea264794f50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 348caea7ba425297ac94ed3837aa91daec5f68f52287ffc00837dafa3b0c3d76e4c7d1e384fdae19fe5641739c57fe2c0c8e717111a905b4dab402870142b1bd
|
7
|
+
data.tar.gz: 4c30b19df9013916f121aeb2d2de52906dcbc46c91f0d6c153153100f0f49e63bc25751b25ea382286f12000503474a882dd061732cf954a8357e7ec3932dec8
|
data/lib/jsb.rb
CHANGED
@@ -25,6 +25,10 @@ class JSB
|
|
25
25
|
def journals
|
26
26
|
parse(@api["/journals"].get(:accept => :json))
|
27
27
|
end
|
28
|
+
|
29
|
+
def journal_exists?(site)
|
30
|
+
@api["/journals/exists"].get(:params => {:site => site}, :accept => :json)
|
31
|
+
end
|
28
32
|
|
29
33
|
# Return a specific journal.
|
30
34
|
#
|
@@ -40,7 +44,7 @@ class JSB
|
|
40
44
|
# journal_id: (Integer) id of journal.
|
41
45
|
# force: (String) if force is true, will force update all data.
|
42
46
|
def journal_sync(journal_id, force = false)
|
43
|
-
parse(@api["/journals/#{journal_id}/sync"].get(:force => force, :accept => :json))
|
47
|
+
parse(@api["/journals/#{journal_id}/sync"].get(:force => force, :accept => :json, :timeout => 180, :open_timeout => 180))
|
44
48
|
end
|
45
49
|
|
46
50
|
# Return a list of issue from a journal.
|
@@ -86,23 +90,23 @@ class JSB
|
|
86
90
|
def journal_apps(journal_id)
|
87
91
|
parse(@api["/journals/#{journal_id}/apps"].get(:accept => :json))
|
88
92
|
end
|
89
|
-
|
93
|
+
|
90
94
|
def journal_app(journal_id, app_id)
|
91
95
|
parse(@api["/journals/#{journal_id}/apps/#{app_id}"].get(:accept => :json))
|
92
96
|
end
|
93
|
-
|
97
|
+
|
94
98
|
def journal_install_app(journal_id, app_id)
|
95
99
|
parse(@api["/journals/#{journal_id}/apps/#{app_id}"].put(:accept => :json))
|
96
100
|
end
|
97
|
-
|
101
|
+
|
98
102
|
def journal_uninstall_app(journal_id, app_id)
|
99
103
|
parse(@api["/journals/#{journal_id}/apps/#{app_id}"].delete(:accept => :json))
|
100
104
|
end
|
101
|
-
|
105
|
+
|
102
106
|
def create_journal(site, xml)
|
103
|
-
parse(@api["/journals"].post(:site => site, :xml => xml, :accept => :json))
|
107
|
+
parse(@api["/journals"].post(:journal => {:site => site, :xml => xml}, :accept => :json, :timeout => 180, :open_timeout => 180))
|
104
108
|
end
|
105
|
-
|
109
|
+
|
106
110
|
# Return a list of articles from author.
|
107
111
|
#
|
108
112
|
# Arguments:
|
@@ -170,19 +174,19 @@ class JSB
|
|
170
174
|
end
|
171
175
|
|
172
176
|
class Apps
|
173
|
-
|
177
|
+
|
174
178
|
def initialize(parent)
|
175
|
-
@parent = parent
|
179
|
+
@parent = parent
|
176
180
|
end
|
177
|
-
|
181
|
+
|
178
182
|
def all
|
179
183
|
@parent.api["/apps"].get :accept => :json
|
180
184
|
end
|
181
|
-
|
185
|
+
|
182
186
|
def app(app_id)
|
183
187
|
@parent.api["/apps/#{app_id}"].get :accept => :json
|
184
188
|
end
|
185
|
-
|
189
|
+
|
186
190
|
end
|
187
|
-
|
191
|
+
|
188
192
|
end
|