nwiki 0.1.8 → 0.1.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eecc56e810f75f0f06584f265493da16b84e3432
4
- data.tar.gz: aed494a9edc8a9d8692acd2397cac1d343792887
3
+ metadata.gz: ffc26a173b4f24504d045cf9eaf01a4a06f89180
4
+ data.tar.gz: aeb5da950c0010e7b6b373934fd1dd04fbc437fe
5
5
  SHA512:
6
- metadata.gz: d64aae30e4cf967ed2ad8364c54034668fb6a71497858777a1ff739ebe05b6058ce17fbb45b3b455783057e8f4e2db1a005e102c3a9545a0b078fc5912ce2740
7
- data.tar.gz: 9dd7b40c8226ac1b86cc3d3c948d69bdf06dc4ca773939c73c1e9fc5b58bbffd4617bbd01a65297144be5c02f67057fd1dc0b122d71b7088d491fb640d84e7d7
6
+ metadata.gz: e561e485ae3aa77172701707242cee18baedf92e77c682676ca8fc85eea6eff933dd98256245bea8b820da5cca557930d91d24a806fdc3289bd910155db57674
7
+ data.tar.gz: 9c324bdc91460f6a5ad3d835165fa7e798363e60d429a186b5cc3c47254e4ee7c95386fa187374a6fc74644f6d26359eaf6ee3dfc352640b3dc9285b19c31d4d
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.1.0
1
+ 2.1.1
data/.travis.yml CHANGED
@@ -1 +1 @@
1
- rvm: 2.1.0
1
+ rvm: 2.1.1
data/CHANGELOG.org CHANGED
@@ -1,4 +1,6 @@
1
1
  * CHANGELOG
2
+ ** 0.1.9
3
+ - [improvement] list order by date newer to older
2
4
  ** 0.1.8
3
5
  - [feature] add git hook for writing commit message easily
4
6
  - [feature] (elisp) sync org-filename with title
data/Gemfile.lock ADDED
@@ -0,0 +1,103 @@
1
+ GIT
2
+ remote: git://github.com/libgit2/rugged.git
3
+ revision: f286099b4d0c5bbcc54ae3005c6603b42a1eabd4
4
+ branch: development
5
+ submodules: true
6
+ specs:
7
+ rugged (0.19.0)
8
+
9
+ PATH
10
+ remote: .
11
+ specs:
12
+ nwiki (0.1.9)
13
+ org-ruby
14
+ rack
15
+
16
+ GEM
17
+ remote: https://rubygems.org/
18
+ specs:
19
+ celluloid (0.15.2)
20
+ timers (~> 1.1.0)
21
+ celluloid-io (0.15.0)
22
+ celluloid (>= 0.15.0)
23
+ nio4r (>= 0.5.0)
24
+ coderay (1.1.0)
25
+ coveralls (0.7.0)
26
+ multi_json (~> 1.3)
27
+ rest-client
28
+ simplecov (>= 0.7)
29
+ term-ansicolor
30
+ thor
31
+ diff-lcs (1.2.5)
32
+ docile (1.1.3)
33
+ ffi (1.9.3)
34
+ formatador (0.2.4)
35
+ guard (2.4.0)
36
+ formatador (>= 0.2.4)
37
+ listen (~> 2.1)
38
+ lumberjack (~> 1.0)
39
+ pry (>= 0.9.12)
40
+ thor (>= 0.18.1)
41
+ guard-rspec (4.2.6)
42
+ guard (~> 2.1)
43
+ rspec (>= 2.14, < 4.0)
44
+ listen (2.5.0)
45
+ celluloid (>= 0.15.2)
46
+ celluloid-io (>= 0.15.0)
47
+ rb-fsevent (>= 0.9.3)
48
+ rb-inotify (>= 0.9)
49
+ lumberjack (1.0.4)
50
+ method_source (0.8.2)
51
+ mime-types (2.1)
52
+ multi_json (1.8.4)
53
+ nio4r (1.0.0)
54
+ org-ruby (0.9.1)
55
+ rubypants (>= 0.2.0)
56
+ pry (0.9.12.6)
57
+ coderay (~> 1.0)
58
+ method_source (~> 0.8)
59
+ slop (~> 3.4)
60
+ rack (1.5.2)
61
+ rack-test (0.6.2)
62
+ rack (>= 1.0)
63
+ rake (10.1.1)
64
+ rb-fsevent (0.9.4)
65
+ rb-inotify (0.9.3)
66
+ ffi (>= 0.5.0)
67
+ rest-client (1.6.7)
68
+ mime-types (>= 1.16)
69
+ rspec (2.14.1)
70
+ rspec-core (~> 2.14.0)
71
+ rspec-expectations (~> 2.14.0)
72
+ rspec-mocks (~> 2.14.0)
73
+ rspec-core (2.14.7)
74
+ rspec-expectations (2.14.5)
75
+ diff-lcs (>= 1.1.3, < 2.0)
76
+ rspec-mocks (2.14.5)
77
+ ruby_gntp (0.3.4)
78
+ rubypants (0.2.0)
79
+ simplecov (0.8.2)
80
+ docile (~> 1.1.0)
81
+ multi_json
82
+ simplecov-html (~> 0.8.0)
83
+ simplecov-html (0.8.0)
84
+ slop (3.4.7)
85
+ term-ansicolor (1.3.0)
86
+ tins (~> 1.0)
87
+ thor (0.18.1)
88
+ timers (1.1.0)
89
+ tins (1.0.0)
90
+
91
+ PLATFORMS
92
+ ruby
93
+
94
+ DEPENDENCIES
95
+ coveralls
96
+ guard
97
+ guard-rspec
98
+ nwiki!
99
+ rack-test
100
+ rake
101
+ rspec
102
+ ruby_gntp
103
+ rugged!
@@ -71,13 +71,26 @@ module Nwiki
71
71
  end
72
72
 
73
73
  def all_files
74
- [].tap do |result|
75
- target = @repo.head.target
76
- @repo.lookup(target).tree.walk_blobs do |path, object|
77
- fullpath = path + object[:name]
78
- result << Entry.new(fullpath, @repo.lookup(object[:oid]))
79
- end
74
+ walker = Rugged::Walker.new(@repo).tap do |w|
75
+ w.sorting(Rugged::SORT_DATE) # new -> old
76
+ w.push(@repo.head.target)
80
77
  end
78
+ [].tap { |result|
79
+ walker.walk.each do |commit|
80
+ parent = commit.parents.first
81
+ next unless parent
82
+ diff = parent.diff(commit)
83
+ diff.deltas.reject(&:deleted?).each do |delta|
84
+ new_file_object = delta.new_file
85
+ fullpath = new_file_object[:path].force_encoding('UTF-8')
86
+ result << Entry.new(fullpath, @repo.lookup(new_file_object[:oid]))
87
+ end
88
+ end
89
+ }.reduce([]) { |acm, e|
90
+ acm.map(&:path).include?(e.path) ? acm : acm << e
91
+ }.reject { |e|
92
+ e.path.start_with?('__nwiki') # TODO HANDLE DELETED ELEMENT
93
+ }
81
94
  end
82
95
 
83
96
  def log
@@ -15,7 +15,7 @@ module Nwiki
15
15
  end
16
16
 
17
17
  def to_html
18
- @parser_class.new(@doc, 1).to_html
18
+ @parser_class.new(@doc, offset: 1).to_html
19
19
  end
20
20
 
21
21
  def == other
data/lib/nwiki/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Nwiki
2
- VERSION = '0.1.8'
2
+ VERSION = '0.1.9'
3
3
  end
@@ -29,7 +29,8 @@ module Nwiki
29
29
 
30
30
  it { expect(subject).to have(5).items }
31
31
  it { expect(subject.first).to be_kind_of Entry}
32
- it { expect(subject.first.path).to eq '1/2/a.org'}
32
+ it { expect(subject.first.path).to eq 'foo.org'}
33
+ it { expect(subject.last.path).to eq '1/2/b.org'}
33
34
  end
34
35
 
35
36
  describe '#log' do
@@ -27,7 +27,7 @@ module Nwiki
27
27
 
28
28
  describe '#find_directory' do
29
29
  it { subject.find_directory('/').list.should eq \
30
- ["1/2/a", "1/2/b", "foo", "日本語ディレクトリ/わたしだ"]
30
+ ["foo", "日本語ディレクトリ/わたしだ", "1/2/a", "1/2/b"]
31
31
  }
32
32
  end
33
33
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nwiki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - niku
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-10 00:00:00.000000000 Z
11
+ date: 2014-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -136,6 +136,7 @@ files:
136
136
  - ".travis.yml"
137
137
  - CHANGELOG.org
138
138
  - Gemfile
139
+ - Gemfile.lock
139
140
  - Guardfile
140
141
  - LICENSE
141
142
  - README.md
@@ -238,7 +239,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
239
  version: '0'
239
240
  requirements: []
240
241
  rubyforge_project:
241
- rubygems_version: 2.2.0
242
+ rubygems_version: 2.2.2
242
243
  signing_key:
243
244
  specification_version: 4
244
245
  summary: Write a gem summary