fossil_wiki_fuse 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/bin/fossil_wiki_fuse +4 -0
- data/lib/fossil_wiki_fuse.rb +42 -0
- metadata +88 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 712a812af0b491b37823eb374a4805214da1ca5f
|
4
|
+
data.tar.gz: 8b13a41bf37be7a92100c4a604af856e87c897ed
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: aadd20c2081373d6da788ec5c7ef43840484bf3b5918c8d59fc95bf424fa95a77e7ddb08aaa943ad3a08b9705e8f1f15bde526dd93983ce5124546841a1f64d2
|
7
|
+
data.tar.gz: 3716b16bce4b777b2d7eec8595554ea307ae2e6ff8b13c50b2940c286230cb15c7e5810998fa275389e21a17bcb6b73b90172bb9d4543a294629c995f0de19a2
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'open3'
|
2
|
+
CMD="fossil wiki "
|
3
|
+
class FossilWikiFuse
|
4
|
+
def initialize
|
5
|
+
@mtimes = {}
|
6
|
+
end
|
7
|
+
def contents path
|
8
|
+
`#{CMD} list`.split("\n").delete_if { |x| x.match "/" }
|
9
|
+
end
|
10
|
+
def file? path
|
11
|
+
contents(nil).include?("#{path[1..-1]}")
|
12
|
+
end
|
13
|
+
def read_file path
|
14
|
+
`#{CMD} export "#{path[1..-1]}"`
|
15
|
+
end
|
16
|
+
def size path
|
17
|
+
read_file(path).size
|
18
|
+
end
|
19
|
+
def can_write? path
|
20
|
+
true
|
21
|
+
end
|
22
|
+
def write_to path, body
|
23
|
+
return if caller[0][/`.*'/][1..-2] == "truncate"
|
24
|
+
action = ((file?(path))?"commit":"create")
|
25
|
+
Open3.popen3("#{CMD}#{action} \"#{path[1..-1]}\"") do |stdin, stdout, stderr|
|
26
|
+
stdin.puts body
|
27
|
+
end
|
28
|
+
@mtimes[path] = Time.now.to_i
|
29
|
+
end
|
30
|
+
def times path
|
31
|
+
[0, @mtimes[path], 0]
|
32
|
+
end
|
33
|
+
def can_delete? path
|
34
|
+
`#{CMD} delete page "#{path[1..-1]}"`
|
35
|
+
end
|
36
|
+
def delete path
|
37
|
+
true
|
38
|
+
end
|
39
|
+
def touch(path, body)
|
40
|
+
write_to path, body
|
41
|
+
end
|
42
|
+
end
|
metadata
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fossil_wiki_fuse
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Olivier Abdesselam
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-10-17 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rfusefs
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: mocha
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: mount your fossil scm wiki on your filesystem
|
56
|
+
email:
|
57
|
+
executables:
|
58
|
+
- fossil_wiki_fuse
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- lib/fossil_wiki_fuse.rb
|
63
|
+
- bin/fossil_wiki_fuse
|
64
|
+
homepage: http://rubygems.org/gems/fossil_wiki_fuse
|
65
|
+
licenses:
|
66
|
+
- MIT
|
67
|
+
metadata: {}
|
68
|
+
post_install_message:
|
69
|
+
rdoc_options: []
|
70
|
+
require_paths:
|
71
|
+
- lib
|
72
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - '>='
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
requirements: []
|
83
|
+
rubyforge_project:
|
84
|
+
rubygems_version: 2.0.3
|
85
|
+
signing_key:
|
86
|
+
specification_version: 4
|
87
|
+
summary: fossil wiki fuse
|
88
|
+
test_files: []
|