middleman-dato 0.5.13 → 0.5.14

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
  SHA1:
3
- metadata.gz: e514bf545d59aaa6843c2ee8d0259a36e8897b40
4
- data.tar.gz: 78f3d9cdc1f73b51ab35b82f8e5c0930c1dd02a5
3
+ metadata.gz: 782c5f987e8280caab87c79ce9e95205c5284dd0
4
+ data.tar.gz: e6fc0b2f38b2e0ed943ed543633bcaf2b036aeb9
5
5
  SHA512:
6
- metadata.gz: 2548e31a5d023fcf633b3b037fe330c1e3cc6de150920a94e17b0e532b79f28d038e66e724073ba152150981b7b04cf31776ec951dd3681a9ca48b6c33847f2a
7
- data.tar.gz: c7888a2cadf22659e248f4031a04a00aaee8cb45be7ed9d080c2618540f8cecf748703a15e0029fca4804148872c516b79c8a5315a2a9651d37f3b454d0c150b
6
+ metadata.gz: 10bf9143fcb77e7bedaaa743f0a30ca1e8a60085e1e1030f8af2c7658523b6a8074186b40ed9bfe5b3a5bb6479378ac07fb26f1bcc7c5d816079d0f3d628f0bb
7
+ data.tar.gz: fd9332e347def3eb5581954e5cfc1b7ecc918f4836d9b35cd7afc6ef27bd4ea5b3cc0098f5843bede72c6230d6374251648cfbd29d574572a2a1c7ff73c20777
data/.travis.yml ADDED
@@ -0,0 +1,12 @@
1
+ language: ruby
2
+
3
+ rvm:
4
+ - "2.0.0"
5
+ - "2.1.1"
6
+ - "2.2.0"
7
+ - "2.3.0"
8
+
9
+ install:
10
+ - bundle install
11
+
12
+ script: "bundle exec rake"
data/README.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # middleman-dato
2
2
 
3
+ [![Build Status](https://travis-ci.org/datocms/middleman-dato.svg?branch=master)](https://travis-ci.org/datocms/middleman-dato)
4
+
5
+ Middleman Dato is a Middleman extension to use the Middleman static site generator together with the API-driven DatoCMS, a fully customizable administrative backend for your static websites.
6
+
7
+ This gem works for Middleman v3 and v4.
8
+
9
+ ## Documentation and video tutorials
10
+
11
+ To learn more about DatoCMS and how you can use it with your Middleman website, head over to [our documentation](http://www.datocms.com/docs/) and [video tutorials](http://www.datocms.com/docs/tutorials/middleman_netlify/).
12
+
3
13
  ## Setup
4
14
 
5
15
  ```ruby
@@ -96,3 +106,22 @@ This helper generates meta tags based on the Favicon image specified within the
96
106
  ```ruby
97
107
  <%= dato_favicon_meta_tags(theme_color: '#D97C5F') %>
98
108
  ```
109
+
110
+ ## Submitting a Pull Request
111
+
112
+ 1. Fork it.
113
+ 2. Create a branch (`git checkout -b some_bufix`)
114
+ 3. Commit your changes (`git commit -am "Fix typos"`)
115
+ 4. Push to the branch (`git push origin some_bugfix`)
116
+ 5. Open a [Pull Request][1]
117
+ 6. Enjoy a refreshing Diet Coke and wait
118
+
119
+ ## Testing
120
+
121
+ To run the tests:
122
+
123
+ $ rake
124
+
125
+ If nothing complains, congratulations!
126
+
127
+ [1]: http://github.com/datocms/middleman-dato/pulls
@@ -20,7 +20,22 @@ module MiddlemanDato
20
20
  end
21
21
 
22
22
  def items
23
- get('items', 'page[limit]' => 10_000).body.with_indifferent_access
23
+ items_per_page = 500
24
+ base_response = get('items', 'page[limit]' => 1).body.
25
+ with_indifferent_access
26
+
27
+ pages = (base_response[:meta][:total_count] / items_per_page.to_f).ceil
28
+ base_response[:data] = []
29
+
30
+ pages.times do |page|
31
+ base_response[:data] += get(
32
+ 'items',
33
+ 'page[offset]' => items_per_page * page,
34
+ 'page[limit]' => items_per_page
35
+ ).body.with_indifferent_access[:data]
36
+ end
37
+
38
+ base_response
24
39
  end
25
40
 
26
41
  def get(*args)
@@ -1,4 +1,4 @@
1
1
  module MiddlemanDato
2
- VERSION = '0.5.13'
2
+ VERSION = '0.5.14'
3
3
  end
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-dato
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.13
4
+ version: 0.5.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Verna
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-04 00:00:00.000000000 Z
11
+ date: 2016-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: middleman-core
@@ -105,6 +105,7 @@ files:
105
105
  - ".gitlab-ci.yml"
106
106
  - ".rspec"
107
107
  - ".rubocop.yml"
108
+ - ".travis.yml"
108
109
  - Gemfile
109
110
  - README.md
110
111
  - Rakefile