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 +4 -4
- data/lib/dato/cli.rb +3 -3
- data/lib/dato/dump/runner.rb +4 -4
- data/lib/dato/local/loader.rb +4 -4
- data/lib/dato/site/paginator.rb +1 -1
- data/lib/dato/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33eb5f4a08ea4ee00d827c628b53bf7d726c558b
|
4
|
+
data.tar.gz: e9ddceb707a78da2fe46d47d6363d227cb3bd558
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 798cf00f4519ea7883e3287b9f4f15f90fdfbff79134992032b7b29c75e3face855dac83a27f389d89c71d15a8cf546530efa36625cc25ad51824d7b97e0453b
|
7
|
+
data.tar.gz: 4cdd4a124d70e78dc9181274245e3b9f45759e167d8749a06256e61891f75be89d8c19d48fbe0109ae5ec7948e3939b5add2830907271de13cd1363877d3bff4
|
data/lib/dato/cli.rb
CHANGED
@@ -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 :
|
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
|
-
|
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,
|
49
|
+
Dump::Runner.new(config_file, client, preview_mode).run
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
data/lib/dato/dump/runner.rb
CHANGED
@@ -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, :
|
10
|
+
attr_reader :config_path, :client, :destination_path, :preview_mode
|
11
11
|
|
12
|
-
def initialize(config_path, client,
|
12
|
+
def initialize(config_path, client, preview_mode, destination_path = Dir.pwd)
|
13
13
|
@config_path = config_path
|
14
|
-
@
|
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,
|
43
|
+
@loader ||= Dato::Local::Loader.new(client, preview_mode)
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
data/lib/dato/local/loader.rb
CHANGED
@@ -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 :
|
11
|
+
attr_reader :preview_mode
|
12
12
|
|
13
|
-
def initialize(client,
|
13
|
+
def initialize(client, preview_mode = false)
|
14
14
|
@client = client
|
15
|
-
@
|
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:
|
34
|
+
{ version: preview_mode ? 'latest' : 'published' },
|
35
35
|
deserialize_response: false,
|
36
36
|
all_pages: true
|
37
37
|
)
|
data/lib/dato/site/paginator.rb
CHANGED
data/lib/dato/version.rb
CHANGED
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
|
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-
|
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:
|
474
|
+
version: '0'
|
475
475
|
requirements: []
|
476
476
|
rubyforge_project:
|
477
477
|
rubygems_version: 2.5.1
|