buttercms-ruby 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -1
- data/VERSION +1 -1
- data/lib/buttercms-ruby.rb +1 -0
- data/lib/buttercms/page.rb +19 -0
- data/lib/buttercms/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9de83f2608d6151ad7cb1a4e5cbb421eedc50c16
|
4
|
+
data.tar.gz: '09ec3183b0a0913b19eeea19794026b45f48f1b7'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53ed13bbeac2651fbaa0263620f6babc82fd1fa15aa19dd0c0ddeeea548848f74ca7b593cf8f47d4561c31a6f1102adfada66c9d427a61545e9976d39f70a976
|
7
|
+
data.tar.gz: 75e9e2eceab99f44da81d95c26580f6afe29bac611c479c14db268c856e929a72d6116aa9a5c9873dc3685cc7291036f6e81f11cc653a240bf0a3bb20802e235
|
data/README.md
CHANGED
@@ -50,11 +50,17 @@ p tags
|
|
50
50
|
rss_feed = ButterCMS::Feed.find(:rss)
|
51
51
|
puts rss_feed.data
|
52
52
|
|
53
|
+
# Content fields
|
53
54
|
content = ButterCMS::Content.fetch([
|
54
55
|
:homepage_html_title,
|
55
56
|
:homepage_meta_description,
|
56
57
|
:homepage_headline
|
57
58
|
])
|
59
|
+
|
60
|
+
# Pages
|
61
|
+
pages = ButterCMS::Page.list('news')
|
62
|
+
|
63
|
+
page = ButterCMS::Page.get('news', 'hello-world')
|
58
64
|
```
|
59
65
|
|
60
66
|
## Localization
|
@@ -86,4 +92,8 @@ Test mode can be used to setup a staging website for previewing content or for t
|
|
86
92
|
|
87
93
|
```ruby
|
88
94
|
ButterCMS::test_mode = true
|
89
|
-
```
|
95
|
+
```
|
96
|
+
|
97
|
+
### Other
|
98
|
+
|
99
|
+
View Ruby [Blog engine](https://buttercms.com/ruby-blog-engine/) and [Full CMS](https://buttercms.com/ruby-cms/) for other examples of using ButterCMS with Ruby.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.3.
|
1
|
+
1.3.1
|
data/lib/buttercms-ruby.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
module ButterCMS
|
2
|
+
class Page < ButterResource
|
3
|
+
def self.resource_path
|
4
|
+
"/pages/"
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.list(page_type, options = {})
|
8
|
+
response = ButterCMS.request(self.endpoint(page_type), options)
|
9
|
+
|
10
|
+
self.create_collection(response)
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.get(page_type, slug, options = {})
|
14
|
+
response = ButterCMS.request(self.endpoint("#{page_type}/#{slug}"), options)
|
15
|
+
|
16
|
+
self.create_object(response)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/buttercms/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: buttercms-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ButterCMS
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -65,6 +65,7 @@ files:
|
|
65
65
|
- lib/buttercms/errors.rb
|
66
66
|
- lib/buttercms/feed.rb
|
67
67
|
- lib/buttercms/hash_to_object.rb
|
68
|
+
- lib/buttercms/page.rb
|
68
69
|
- lib/buttercms/post.rb
|
69
70
|
- lib/buttercms/tag.rb
|
70
71
|
- lib/buttercms/version.rb
|