vimfluence 0.0.1 → 0.0.2

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: 928465b5411265f890eb4eb83b2e72a6568c220c
4
- data.tar.gz: d2b94170969fe4c0fb15787b50313fd3ad321c97
3
+ metadata.gz: 17b19b09ef589c50e82f5130ab1b949c6f5e933a
4
+ data.tar.gz: ac4910390c2c899eb03d38da786e6e3c6a9ee128
5
5
  SHA512:
6
- metadata.gz: 559f675a8fa44e83f50a0e30af79a094d716f75702167b73f7203d5f17c31ba80b8c7573027a5fd7ac084a3ba2e28fe244e20822ac834c2f0f4746ced1542f9f
7
- data.tar.gz: db6892c80781d633ace65b41a82fc81fd955d587150088cf263ad3758a22f6c389a7ed6fab16ecf860e8d465e4c88b25a902ccbbf4ffc44f5858de0086dfc64f
6
+ metadata.gz: 3e7db98914ed15f10b3304724080560fc5c4bffd794ac32575f800f1e94b3f0c67afe173f48b0627fc6e009c3073fc3915a142ffe39e392e2d27d8b49224c4b7
7
+ data.tar.gz: 8cad6c3235f30d2029358e646c3dd417fdf91f48b56966840313aa78d44d91fa68c581a0328e1ad283c7d1ec91f090520c7bf964b2cb7c5847ad8defd32461a4
data/README.md CHANGED
@@ -5,19 +5,22 @@ Pure ruby version of https://github.com/orlandov/vimfluence
5
5
 
6
6
  To use:
7
7
 
8
- vimfluence.rb: `vimfluence PageSpace "Wiki Page"`
8
+ `vimfluence PageSpace "Wiki Page"`
9
9
 
10
10
  Settings:
11
11
 
12
- Location of confluence wiki
12
+ Location of confluence wiki:
13
+
13
14
  `export WIKI_URL=http://hub.example.com/wiki`
14
15
 
15
- Confluence user (or defaults to `Etc.login`)
16
+ Confluence user (or defaults to Etc.login):
17
+
16
18
  `export WIKI_USER=bob`
17
19
 
18
- Confluence user password
20
+ Confluence user password:
21
+
19
22
  `export WIKI_PASS=insecure`
20
23
 
21
- or use value stored in OSX keychain
24
+ or use value stored in OSX keychain:
22
25
 
23
26
  `export WIKI_PASS_KEYCHAIN_KEY=keychain_key`
data/bin/vimfluence CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  require 'rubygems'
4
4
  require 'etc'
5
- require 'nokogiri'
6
5
  require 'tempfile'
7
6
  require 'xmlrpc/client'
8
7
 
@@ -10,16 +9,18 @@ SPACE = ARGV[0]
10
9
  PAGE = ARGV[1]
11
10
  URL = ENV["WIKI_URL"]
12
11
  WIKI_USER = ENV["WIKI_USER"] || Etc.getlogin
12
+ WIKI_EXTENSION = ENV["WIKI_EXTENSION"] || 'confluencewiki'
13
13
  WIKI_PASS = ENV["WIKI_PASS"] || `security find-generic-password -g -w -s #{ENV["WIKI_PASS_KEYCHAIN_KEY"]}`.strip
14
+ EDITOR = ENV["EDITOR"] || "vim"
14
15
  client = XMLRPC::Client.new2("#{URL}/rpc/xmlrpc")
15
16
  client.http_header_extra = {"Accept-Encoding" => "identity"}
16
17
  client = client.proxy("confluence2")
17
18
  token = client.login(WIKI_USER, WIKI_PASS)
18
19
  page = client.getPage(token, SPACE, PAGE)
19
- file = Tempfile.new(["#{SPACE}-#{PAGE}", '.xml'])
20
+ file = Tempfile.new(["#{SPACE}-#{PAGE}", ".#{WIKI_EXTENSION}"])
20
21
  old_content = page["content"]
21
22
  file.write(old_content)
22
- system("vim '#{file.path}'")
23
+ system("#{EDITOR} '#{file.path}'")
23
24
  new_content = File.read(file.path)
24
25
  unless old_content.eql? new_content
25
26
  page["content"] = new_content
@@ -1,3 +1,3 @@
1
1
  module Vimfluence
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vimfluence
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sumit Shah
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-20 00:00:00.000000000 Z
11
+ date: 2013-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler