atlas_rb 0.0.51 → 0.0.53

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f78863fef4432801dba4cb1de1c2b967f762a6d9bbba10f2b3d91a2a920fa81b
4
- data.tar.gz: 6cb431659461f91c839db650f424ac11d528cd004ac2b6367d6f9c4bd0aed4d1
3
+ metadata.gz: a7d9df70b466e4b62db94dd27024137fccb16c3f18b06821a93124ce0b6c15a9
4
+ data.tar.gz: e8fbecc7b36ae97725201ed0b3db1fdbf3f81d1b0085ea3d0ce3526bbcd5e9b2
5
5
  SHA512:
6
- metadata.gz: 4431eb55db66fedc0284694e98da88d3bd21a5dc1deb18232e7e0dc9ff492705b5081aba1d5dd35fcd7e67bc4bebbe6b8bb6a894f8a0b2502e93efc36968e86d
7
- data.tar.gz: 2185bad0936ea1d94cea570c06817408318a34697e100ec996dfda9d5ed2c540447c85c42f3062e3b22216e5a9c3c2f7400f0b80b3e2a0a4fa1cce4abe1a41d1
6
+ metadata.gz: 3f655fc91584e99757f706e417fa8480ae53dc4d913227f885ef9e981d0a0056c3456bbce50bc71fe6e536f6a9dea712fabedecf54f1c7869d0fe66df407bd20
7
+ data.tar.gz: c7b0b663ca55eefe8c7fb5c35e53cd2f0dfac9facfb938094532dc0d05c494c9138ee159409c023fa155b55edf83e0cd88221e78ef6260ee67ecb2bcbf5e26f8
data/.version CHANGED
@@ -1 +1 @@
1
- 0.0.51
1
+ 0.0.53
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- atlas_rb (0.0.51)
4
+ atlas_rb (0.0.53)
5
5
  faraday (~> 2.7)
6
6
  faraday-follow_redirects (~> 0.3.0)
7
7
  faraday-multipart (~> 1)
@@ -8,9 +8,12 @@ module AtlasRb
8
8
  JSON.parse(connection({}).get(ROUTE + id)&.body)["collection"]
9
9
  end
10
10
 
11
- def self.create(id)
12
- # params[:parent_id]
13
- JSON.parse(connection({ parent_id: id }).post(ROUTE)&.body)["collection"]
11
+ def self.create(id, xml_path = nil)
12
+ result = JSON.parse(connection({ parent_id: id }).post(ROUTE)&.body)["collection"]
13
+ return unless xml_path.present?
14
+
15
+ update(result["id"], xml_path)
16
+ find(result["id"])
14
17
  end
15
18
 
16
19
  def self.destroy(id)
@@ -10,8 +10,10 @@ module AtlasRb
10
10
 
11
11
  def self.create(id = nil, xml_path = nil)
12
12
  result = JSON.parse(connection({ parent_id: id }).post(ROUTE)&.body)["community"]
13
- update(result["id"], xml_path) if xml_path.present?
14
- result
13
+ return unless xml_path.present?
14
+
15
+ update(result["id"], xml_path)
16
+ find(result["id"])
15
17
  end
16
18
 
17
19
  def self.destroy(id)
data/lib/atlas_rb/work.rb CHANGED
@@ -8,9 +8,12 @@ module AtlasRb
8
8
  JSON.parse(connection({}).get(ROUTE + id)&.body)["work"]
9
9
  end
10
10
 
11
- def self.create(id)
12
- # params[:collection_id]
11
+ def self.create(id, xml_path = nil)
13
12
  JSON.parse(connection({ collection_id: id }).post(ROUTE)&.body)["work"]
13
+ return unless xml_path.present?
14
+
15
+ update(result["id"], xml_path)
16
+ find(result["id"])
14
17
  end
15
18
 
16
19
  def self.destroy(id)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atlas_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.51
4
+ version: 0.0.53
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cliff