metaweblog 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +5 -1
- data/CHANGELOG.md +4 -0
- data/lib/metaweblog.rb +0 -2
- data/lib/metaweblog/client.rb +0 -2
- data/lib/metaweblog/post.rb +7 -7
- data/lib/metaweblog/version.rb +1 -1
- data/metaweblog.gemspec +15 -15
- data/spec/metaweblog/client_spec.rb +2 -4
- data/spec/metaweblog/post_spec.rb +2 -2
- metadata +21 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 829a15e160a83414497da7661186978a81f019c36de24ed4796fd8122ced7453
|
4
|
+
data.tar.gz: 93f59e35175adffd4b4bd69781f98a8a72af547f3204154d286420fed3ace841
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74d4b2d70172c039ad637f1679135c7cc8fc6da399aa2e302dcd179710ef059834e9939b85f7ceaaea0014b37bb6e4a9f46d648cac4d81c7845ae6ff107c2cf7
|
7
|
+
data.tar.gz: 5fa613249267e8626254727ca49b54ca6fd6c1bdd21a5362e6e1d2cb1c5d16430fb1dee1ff836dc775522f9d368f33e164de74ca78ee0faf0a1b99f1f4be61fd
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/lib/metaweblog.rb
CHANGED
data/lib/metaweblog/client.rb
CHANGED
data/lib/metaweblog/post.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
|
1
|
+
require 'time'
|
2
2
|
|
3
3
|
module MetaWeblog
|
4
4
|
|
5
5
|
class Post
|
6
6
|
def self.members
|
7
|
-
[
|
7
|
+
%i[title link description pubDate]
|
8
8
|
end
|
9
9
|
|
10
10
|
def initialize(*args)
|
@@ -17,7 +17,7 @@ module MetaWeblog
|
|
17
17
|
data = args
|
18
18
|
end
|
19
19
|
self.class.members.each_with_index do |member, i|
|
20
|
-
|
20
|
+
__send__ "#{member}=", data[i] if data[i]
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -40,14 +40,14 @@ module MetaWeblog
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def pub_date=(pub_date)
|
43
|
-
@data[:pubDate] =
|
43
|
+
@data[:pubDate] =
|
44
|
+
case pub_date
|
44
45
|
when String then Time.parse(pub_date)
|
45
46
|
when Time, DateTime then pub_date
|
46
47
|
else
|
47
|
-
raise ArgumentError,
|
48
|
+
raise ArgumentError, 'The argument is not String, Time and DateTime.'
|
48
49
|
end
|
49
50
|
end
|
50
|
-
alias
|
51
|
-
|
51
|
+
alias pubDate= pub_date=
|
52
52
|
end
|
53
53
|
end
|
data/lib/metaweblog/version.rb
CHANGED
data/metaweblog.gemspec
CHANGED
@@ -1,33 +1,33 @@
|
|
1
|
-
lib = File.expand_path('
|
1
|
+
lib = File.expand_path(File.join(__dir__, 'lib'))
|
2
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
3
|
require 'metaweblog/version'
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
|
-
spec.name =
|
6
|
+
spec.name = 'metaweblog'
|
7
7
|
spec.version = MetaWeblog::VERSION
|
8
|
-
spec.authors = [
|
9
|
-
spec.email = [
|
8
|
+
spec.authors = ['Tatsuya Sato']
|
9
|
+
spec.email = ['satoryu.1981@gmail.com']
|
10
10
|
spec.description = <<-DESC
|
11
11
|
Ruby client for metaWeblog API.
|
12
12
|
This gem makes it easier for developers to talk with your Blog supporting
|
13
|
-
metaWeblog API.
|
14
|
-
This gem only depends on REXML provided as one of Ruby's standard lib.
|
13
|
+
metaWeblog API.
|
14
|
+
This gem only depends on REXML provided as one of Ruby's standard lib.
|
15
15
|
DESC
|
16
|
-
spec.summary =
|
17
|
-
spec.homepage =
|
18
|
-
spec.license =
|
19
|
-
spec.required_ruby_version = '>= 2.
|
16
|
+
spec.summary = 'Ruby client for metaWeblog API.'
|
17
|
+
spec.homepage = 'http://github.com/satoryu/metaweblog'
|
18
|
+
spec.license = 'MIT'
|
19
|
+
spec.required_ruby_version = '>= 2.2.0'
|
20
20
|
spec.rdoc_options = %w[
|
21
21
|
--main=README.md
|
22
22
|
--exclude=Gemfile --exclude=Rakefile --exclude=*.gemspec
|
23
23
|
]
|
24
24
|
|
25
|
-
spec.files = `git ls-files`.split(
|
25
|
+
spec.files = `git ls-files`.split($RS)
|
26
26
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
27
27
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
28
|
-
spec.require_paths = [
|
28
|
+
spec.require_paths = ['lib']
|
29
29
|
|
30
|
-
spec.add_development_dependency
|
31
|
-
spec.add_development_dependency
|
32
|
-
spec.add_development_dependency
|
30
|
+
spec.add_development_dependency 'bundler', '~> 1.16.1'
|
31
|
+
spec.add_development_dependency 'rake', '~> 12.3.0'
|
32
|
+
spec.add_development_dependency 'rspec', '~> 3.7.0'
|
33
33
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
1
|
require 'spec_helper'
|
4
2
|
|
5
3
|
describe MetaWeblog::Client do
|
@@ -28,14 +26,14 @@ describe MetaWeblog::Client do
|
|
28
26
|
end
|
29
27
|
end
|
30
28
|
|
31
|
-
describe
|
29
|
+
describe '#get' do
|
32
30
|
let(:post_id) { 12345 }
|
33
31
|
|
34
32
|
before do
|
35
33
|
expect(@xml_client).to receive(:call).with('metaWeblog.getPost', post_id, 'username', 'password')
|
36
34
|
end
|
37
35
|
|
38
|
-
it do
|
36
|
+
it do
|
39
37
|
expect { @client.get(post_id) }.not_to raise_error
|
40
38
|
end
|
41
39
|
end
|
@@ -6,7 +6,7 @@ describe MetaWeblog::Post do
|
|
6
6
|
describe '#initialize' do
|
7
7
|
context 'Given an array of values' do
|
8
8
|
let(:args) do
|
9
|
-
[
|
9
|
+
['title', 'http://blog.example.com/1234', 'desc']
|
10
10
|
end
|
11
11
|
|
12
12
|
specify '' do
|
@@ -18,7 +18,7 @@ describe MetaWeblog::Post do
|
|
18
18
|
|
19
19
|
context 'Given only a hash' do
|
20
20
|
let(:args) do
|
21
|
-
[{
|
21
|
+
[{title: 'Hello', 'description' => 'This is blog', extra: 'not defined' }]
|
22
22
|
end
|
23
23
|
|
24
24
|
specify 'should assign values for members' do
|
metadata
CHANGED
@@ -1,60 +1,62 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metaweblog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tatsuya Sato
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.16.1
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 1.16.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.
|
33
|
+
version: 12.3.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 3.
|
40
|
+
version: 12.3.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 3.7.0
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
55
|
-
description:
|
56
|
-
|
57
|
-
|
54
|
+
version: 3.7.0
|
55
|
+
description: |2
|
56
|
+
Ruby client for metaWeblog API.
|
57
|
+
This gem makes it easier for developers to talk with your Blog supporting
|
58
|
+
metaWeblog API.
|
59
|
+
This gem only depends on REXML provided as one of Ruby's standard lib.
|
58
60
|
email:
|
59
61
|
- satoryu.1981@gmail.com
|
60
62
|
executables: []
|
@@ -96,7 +98,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
96
98
|
requirements:
|
97
99
|
- - ">="
|
98
100
|
- !ruby/object:Gem::Version
|
99
|
-
version: 2.
|
101
|
+
version: 2.2.0
|
100
102
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
103
|
requirements:
|
102
104
|
- - ">="
|
@@ -104,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
106
|
version: '0'
|
105
107
|
requirements: []
|
106
108
|
rubyforge_project:
|
107
|
-
rubygems_version: 2.
|
109
|
+
rubygems_version: 2.7.3
|
108
110
|
signing_key:
|
109
111
|
specification_version: 4
|
110
112
|
summary: Ruby client for metaWeblog API.
|