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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/jsb.rb +17 -13
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a5ff659beedf72c51ea60cf20c6c3dfd3d4e66bb
4
- data.tar.gz: 204db055e97d4b5878f0305c3b987dace177a4f0
3
+ metadata.gz: e8cc634a4142a3bd3aad582aae2572fad872e75f
4
+ data.tar.gz: 674e012b2c034bbf8695582d10081ea264794f50
5
5
  SHA512:
6
- metadata.gz: 728df59908ad6c8b94bda3e7f93093723304c57540379d7a54c6aab956cee1e2833aa33c742c3417677edcc04d234fb04905c5c6bf13fa3621a7957073fc61c2
7
- data.tar.gz: 593a2ab6e76286cbdf86250e3a54618d0517c59596222fca96a2ef4f9259351eb4a34921149a8fe2258d88cb4b9c71c5fcf71ebdf816adfac8adac37bf8b9ca9
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsb_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Definity Solutions