dato 0.4.0.pre → 0.4.0

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: f85c8c3d4e34d55aa8964841977e367a733be9a6
4
- data.tar.gz: 5f28df9e2518781045640b7f6cd5a98f4f4cd6c1
3
+ metadata.gz: 33eb5f4a08ea4ee00d827c628b53bf7d726c558b
4
+ data.tar.gz: e9ddceb707a78da2fe46d47d6363d227cb3bd558
5
5
  SHA512:
6
- metadata.gz: 3e272ffbaccb62c8ce4f738ba2868adbfa6f200af79ae74d36833f10b7ffee3a82008cc7c047331ba097e1262e3debc2ffa9c77a320b29e0f837cc35f47cfd75
7
- data.tar.gz: 32a7c6185fad31b06d5a2ce34c78c36c7ad287a3ed2dcb1ff23e0b4ee4d249a17e4dac0d4867c32482150a6d56a6064d60e9b41f335caeb241b128b598380574
6
+ metadata.gz: 798cf00f4519ea7883e3287b9f4f15f90fdfbff79134992032b7b29c75e3face855dac83a27f389d89c71d15a8cf546530efa36625cc25ad51824d7b97e0453b
7
+ data.tar.gz: 4cdd4a124d70e78dc9181274245e3b9f45759e167d8749a06256e61891f75be89d8c19d48fbe0109ae5ec7948e3939b5add2830907271de13cd1363877d3bff4
@@ -14,12 +14,12 @@ module Dato
14
14
  desc 'dump', 'dumps DatoCMS content into local files'
15
15
  option :config, default: 'dato.config.rb'
16
16
  option :token, default: ENV['DATO_API_TOKEN'], required: true
17
- option :draft, default: false, type: :boolean
17
+ option :preview, default: false, type: :boolean
18
18
  option :watch, default: false, type: :boolean
19
19
  def dump
20
20
  config_file = File.expand_path(options[:config])
21
21
  watch_mode = options[:watch]
22
- draft_mode = options[:draft]
22
+ preview_mode = options[:preview]
23
23
 
24
24
  client = Dato::Site::Client.new(
25
25
  options[:token],
@@ -46,7 +46,7 @@ module Dato
46
46
 
47
47
  sleep
48
48
  else
49
- Dump::Runner.new(config_file, client, draft_mode).run
49
+ Dump::Runner.new(config_file, client, preview_mode).run
50
50
  end
51
51
  end
52
52
 
@@ -7,11 +7,11 @@ require 'dato/local/loader'
7
7
  module Dato
8
8
  module Dump
9
9
  class Runner
10
- attr_reader :config_path, :client, :destination_path, :draft_mode
10
+ attr_reader :config_path, :client, :destination_path, :preview_mode
11
11
 
12
- def initialize(config_path, client, draft_mode, destination_path = Dir.pwd)
12
+ def initialize(config_path, client, preview_mode, destination_path = Dir.pwd)
13
13
  @config_path = config_path
14
- @draft_mode = draft_mode
14
+ @preview_mode = preview_mode
15
15
  @client = client
16
16
  @destination_path = destination_path
17
17
  end
@@ -40,7 +40,7 @@ module Dato
40
40
  end
41
41
 
42
42
  def loader
43
- @loader ||= Dato::Local::Loader.new(client, draft_mode)
43
+ @loader ||= Dato::Local::Loader.new(client, preview_mode)
44
44
  end
45
45
  end
46
46
  end
@@ -8,11 +8,11 @@ module Dato
8
8
  attr_reader :client
9
9
  attr_reader :entities_repo
10
10
  attr_reader :items_repo
11
- attr_reader :draft_mode
11
+ attr_reader :preview_mode
12
12
 
13
- def initialize(client, draft_mode = false)
13
+ def initialize(client, preview_mode = false)
14
14
  @client = client
15
- @draft_mode = draft_mode
15
+ @preview_mode = preview_mode
16
16
  @entities_repo = EntitiesRepo.new
17
17
  @items_repo = ItemsRepo.new(@entities_repo)
18
18
  end
@@ -31,7 +31,7 @@ module Dato
31
31
 
32
32
  def all_items
33
33
  client.items.all(
34
- { version: draft_mode ? 'current' : 'published' },
34
+ { version: preview_mode ? 'latest' : 'published' },
35
35
  deserialize_response: false,
36
36
  all_pages: true
37
37
  )
@@ -6,7 +6,7 @@ module Dato
6
6
  end
7
7
 
8
8
  def response
9
- items_per_page = 500
9
+ items_per_page = 100
10
10
 
11
11
  base_response = @client.request(
12
12
  :get, @base_endpoint, @filters.dup.merge('page[limit]' => items_per_page)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Dato
3
- VERSION = '0.4.0.pre'
3
+ VERSION = '0.4.0'
4
4
  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.4.0.pre
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Verna
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-15 00:00:00.000000000 Z
11
+ date: 2018-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -469,9 +469,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
469
469
  version: '0'
470
470
  required_rubygems_version: !ruby/object:Gem::Requirement
471
471
  requirements:
472
- - - ">"
472
+ - - ">="
473
473
  - !ruby/object:Gem::Version
474
- version: 1.3.1
474
+ version: '0'
475
475
  requirements: []
476
476
  rubyforge_project:
477
477
  rubygems_version: 2.5.1