dato 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d2cfedd8e15769b9218672800af0046479d30ccc
4
- data.tar.gz: eb04df8bdb2301f4359dbf138b7a285e42071499
3
+ metadata.gz: 82c1636f441fbd46c8331b4a3a17d005560de0e8
4
+ data.tar.gz: c37302cbe0003a7188dcc6c4344876eab27f1b23
5
5
  SHA512:
6
- metadata.gz: 427934ad134d83a54495b354d8cf7b49b74278f7970b17ba8780eb73e0db49ca8d1c5d52c3df9c69561cf3a476f72b85384da243c3442b510ffc8845b63627cc
7
- data.tar.gz: 3e5092deff45594a4539c7c757a90d5697273089775cb9436648fadd1d493ac1b10739cf29e28376907953350a1a542a4eb060537fa3d36dac0050138eab3e07
6
+ metadata.gz: daa7cca64ddccfedde2a6fa675111c2b11f92f944c61aa0ebdc69114f2d84c4701e1357d92b164a25b10a7db373b2735c0a7377bef2aec98eba168b2a0b2481b
7
+ data.tar.gz: b9c65378b99fda7b554f62c9191a5dddea274847bf09cd05f7968bec8074be49e4fcb5017fa3af572f13e7d30f937067d3d00250dcc527d9cfac0e50906093f7
data/.gitignore CHANGED
@@ -9,3 +9,4 @@
9
9
  /coverage/
10
10
  /tmp/
11
11
  build.zip
12
+ .env
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
+ require "open-uri"
3
4
 
4
- require_relative "./build/download_schema"
5
5
  require_relative "./build/build_client"
6
6
 
7
7
  RSpec::Core::RakeTask.new(:spec)
@@ -9,16 +9,14 @@ RSpec::Core::RakeTask.new(:spec)
9
9
  task :default => :spec
10
10
 
11
11
  task :build_repos do
12
- downloader = DownloadSchema.new("y32upcTKLupUjXiC9nFW", "182")
13
-
14
12
  BuildClient.new(
15
- downloader.schema("backend-hyperschema.json"),
13
+ open("https://site-api.datocms.com/docs/site-api-hyperschema.json").read,
16
14
  "site",
17
15
  %w(session item)
18
16
  ).build
19
17
 
20
18
  BuildClient.new(
21
- downloader.schema("frontend-hyperschema.json"),
19
+ open("https://site-api.datocms.com/docs/account-api-hyperschema.json").read,
22
20
  "account",
23
21
  %w(session item)
24
22
  ).build
@@ -16,7 +16,7 @@ module Dato
16
16
  def create(resource_attributes)
17
17
  body = JsonApiSerializer.new(
18
18
  type: :site,
19
- attributes: %i(domain name notes),
19
+ attributes: %i(domain name notes template),
20
20
  ).serialize(resource_attributes)
21
21
 
22
22
  post_request "/sites", body
@@ -35,6 +35,15 @@ module Dato
35
35
  delete_request "/sites/#{site_id}"
36
36
  end
37
37
 
38
+ def duplicate(site_id, resource_attributes)
39
+ body = JsonApiSerializer.new(
40
+ type: :site,
41
+ attributes: %i(name),
42
+ ).serialize(resource_attributes)
43
+
44
+ post_request "/sites/#{site_id}/duplicate", body
45
+ end
46
+
38
47
  end
39
48
  end
40
49
  end
@@ -1,3 +1,3 @@
1
1
  module Dato
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dato
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Verna
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-23 00:00:00.000000000 Z
11
+ date: 2016-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler