mores 0.1.6 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mores/patch/file_utils.rb +31 -0
- data/lib/mores/version.rb +1 -1
- data/lib/mores.rb +13 -5
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f48b9b021f0ed8beefabb1e22879bb2a1724ad4
|
4
|
+
data.tar.gz: 46351eb0e184e6d34f1c6c8a41699993dbaaf47b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 403e5ff2f0a145cdbe80f6745877124960475ecaa7ca2af40c889e89a20acde6f078a9e8c2b88aeb7206dc636d6e10b926f5b64721c2414f11d00327c7517892
|
7
|
+
data.tar.gz: 0fd000095d08cca21cbdafad88ab32cce09f60f54e56f8518366c4e70f555bf279c087fc7c6a1fac25e5a872e9155ec8751a42df4dc785ae148827e4bf0814fd
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
module Mores::Patch::FileUtils
|
4
|
+
|
5
|
+
refine ::FileUtils.singleton_class do
|
6
|
+
def compare_stream(a, b)
|
7
|
+
bsize = stream_blksize(a, b)
|
8
|
+
sa = 0.chr(Encoding::BINARY) * bsize
|
9
|
+
sb = 0.chr(Encoding::BINARY) * bsize
|
10
|
+
begin
|
11
|
+
a.read(bsize, sa)
|
12
|
+
b.read(bsize, sb)
|
13
|
+
return true if sa.empty? && sb.empty?
|
14
|
+
end while sa == sb
|
15
|
+
false
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def stream_blksize(*streams)
|
21
|
+
streams.each do |s|
|
22
|
+
s.respond_to?(:stat) and
|
23
|
+
blksize = s.stat.blksize and
|
24
|
+
0 != blksize and
|
25
|
+
return blksize
|
26
|
+
end
|
27
|
+
0x400
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
data/lib/mores/version.rb
CHANGED
data/lib/mores.rb
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
%w[
|
2
2
|
version
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
].each { |file| require_relative "mores/#{file}" }
|
4
|
+
|
5
|
+
module Mores
|
6
|
+
module Patch end
|
7
|
+
end
|
8
|
+
|
9
|
+
[
|
10
|
+
[Mores::Patch, :FileUtils, 'patch/file_utils'],
|
11
|
+
[Mores, :BlockInitialize, 'block_initialize'],
|
12
|
+
[Mores, :LinkedList, 'linked_list' ],
|
13
|
+
[Mores, :Succession, 'succession' ],
|
14
|
+
[Mores, :ImmutableStruct, 'immutable_struct'],
|
15
|
+
].each { |(mod, name, file)| mod.autoload name, "mores/#{file}" }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mores
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Petter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -82,6 +82,7 @@ files:
|
|
82
82
|
- lib/mores/immutable_struct/flyweight.rb
|
83
83
|
- lib/mores/immutable_struct/strict.rb
|
84
84
|
- lib/mores/linked_list.rb
|
85
|
+
- lib/mores/patch/file_utils.rb
|
85
86
|
- lib/mores/succession.rb
|
86
87
|
- lib/mores/version.rb
|
87
88
|
- mores.gemspec
|