wp2hatena 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2d08ca24e7d9d8bd4f3335290ded1984a485b119
4
- data.tar.gz: 55e174d51045ec03af56cb49f30c32bc736da82e
3
+ metadata.gz: ad46f72056091e04b625687a779bf23596c57f56
4
+ data.tar.gz: 45c0ccaa958b30a086671644ed5bf3d9515f56ad
5
5
  SHA512:
6
- metadata.gz: 749f102c9b6428528a506dfde274f61337d40ce6a14f37a9f66991368062dc26d647b32435d28e84a433c1c366c21f1271d46c11fd707eab2922d317b41fd36a
7
- data.tar.gz: f79abb26d9183abc834406b71a06ad26bd67de5a9b8a5531d6d0c3046230708c763c4d29bbbd23438578ad4e9879c2010fea6c6af1151441a97638b4f9060e55
6
+ metadata.gz: 99621b40c536316eddc37c10ac33350d754f0abed0f6660577d2ebeecb78ffa086bff7a2316f7621d442b81b1a497322740121295c09de489259ad072c2a3df1
7
+ data.tar.gz: 0f11ee552f4aac84231516e8872bfc6f9e019f0fa3521211f16b0d3e8d7955833310f5b0f0fcd38f42244ee64f3a2df5c89ceaacb787fe8d786aabfed238dbb0
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rexml/document'
4
+ require 'uri'
5
+
6
+ print 'WORDPRESS_XML_PATH:'
7
+ WORDPRESS_XML_PATH = gets.chomp
8
+
9
+ open(WORDPRESS_XML_PATH, 'r') do |fp|
10
+ buffer = fp.read
11
+ doc = REXML::Document.new(buffer)
12
+ REXML::XPath.match(doc, "//wp:post_name").map do |post_name|
13
+ next if post_name.text.nil?
14
+ buffer.gsub!(post_name.text, URI.decode(post_name.text))
15
+ end
16
+
17
+ File.write(
18
+ WORDPRESS_XML_PATH.gsub(/\.xml$/, '.decoded.xml'),
19
+ buffer
20
+ )
21
+ end
@@ -1,3 +1,3 @@
1
1
  module Wp2hatena
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wp2hatena
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - utahta
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-08-30 00:00:00.000000000 Z
11
+ date: 2015-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -71,6 +71,7 @@ email:
71
71
  - labs.ninxit@gmail.com
72
72
  executables:
73
73
  - wp2hatena
74
+ - wp2hatena_decode
74
75
  - wp2hatena_oauth
75
76
  extensions: []
76
77
  extra_rdoc_files: []
@@ -83,6 +84,7 @@ files:
83
84
  - bin/console
84
85
  - bin/setup
85
86
  - exe/wp2hatena
87
+ - exe/wp2hatena_decode
86
88
  - exe/wp2hatena_oauth
87
89
  - lib/wp2hatena.rb
88
90
  - lib/wp2hatena/hatena/converter.rb