hatenablog 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -0
- data/Gemfile +2 -0
- data/README.md +16 -1
- data/lib/hatenablog/configuration.rb +2 -1
- data/lib/hatenablog/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1784b95efbc79289c1fcaefa30ae898223454a17
|
4
|
+
data.tar.gz: 0a57f752ea79980d82cd6fd4d11f020cabcfed24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a7e3181855b17a2aa47863c0279eb661f816bc242e90426feb3a67fde522d35c6c8674005be320e4932e1d7230a83255f79de0b899c9204196e9091e9b7d012
|
7
|
+
data.tar.gz: d2e5ba03fb472e2e2bae2628c9ea46f0c9a805105849ca10b2d56911235859fd829d1e0940feedf5203c8c86ae6a8760ab75c1878d020ee8cf82fc608705dc6b
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
-
# Hatenablog
|
1
|
+
# Hatenablog
|
2
|
+
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/hatenablog.svg)](https://badge.fury.io/rb/hatenablog) [![Build Status](https://travis-ci.org/kymmt90/hatenablog.svg?branch=master)](https://travis-ci.org/kymmt90/hatenablog)
|
4
|
+
[![Code Climate](https://codeclimate.com/github/kymmt90/hatenablog/badges/gpa.svg)](https://codeclimate.com/github/kymmt90/hatenablog)
|
5
|
+
[![Test Coverage](https://codeclimate.com/github/kymmt90/hatenablog/badges/coverage.svg)](https://codeclimate.com/github/kymmt90/hatenablog/coverage)
|
2
6
|
|
3
7
|
A library for Hatenablog AtomPub API.
|
4
8
|
This gem supports following operations using OAuth authorization:
|
@@ -55,6 +59,17 @@ user_id: <Hatena user ID>
|
|
55
59
|
blog_id: <Hatenablog ID>
|
56
60
|
```
|
57
61
|
|
62
|
+
This file accepts ERB syntax.
|
63
|
+
|
64
|
+
```yml
|
65
|
+
consumer_key: <%= ENV['CONSUMER_KEY'] %>
|
66
|
+
consumer_secret: <%= ENV['CONSUMER_SECRET'] %>
|
67
|
+
access_token: <%= ENV['ACCESS_TOKEN'] %>
|
68
|
+
access_token_secret: <%= ENV['ACCESS_TOKEN_SECRET'] %>
|
69
|
+
user_id: <%= ENV['USER_ID'] %>
|
70
|
+
blog_id: <%= ENV['BLOG_ID'] %>
|
71
|
+
```
|
72
|
+
|
58
73
|
## Usage
|
59
74
|
|
60
75
|
```ruby
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'erb'
|
1
2
|
require 'yaml'
|
2
3
|
|
3
4
|
module Hatenablog
|
@@ -11,7 +12,7 @@ module Hatenablog
|
|
11
12
|
# @param [String] config_file configuration file path
|
12
13
|
# @return [Hatenablog::Configuration]
|
13
14
|
def initialize(config_file)
|
14
|
-
config = YAML.
|
15
|
+
config = YAML.load(ERB.new(File.read(config_file)).result)
|
15
16
|
unless config.has_key?('consumer_key') && config.has_key?('consumer_secret') &&
|
16
17
|
config.has_key?('access_token') && config.has_key?('access_token_secret') &&
|
17
18
|
config.has_key?('user_id') && config.has_key?('blog_id')
|
data/lib/hatenablog/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hatenablog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kohei Yamamoto
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
167
|
version: '0'
|
168
168
|
requirements: []
|
169
169
|
rubyforge_project:
|
170
|
-
rubygems_version: 2.
|
170
|
+
rubygems_version: 2.5.1
|
171
171
|
signing_key:
|
172
172
|
specification_version: 4
|
173
173
|
summary: Hatenablog AtomPub API library
|