capillary 1.0.0 → 1.0.1
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.
- data/Gemfile.lock +1 -1
- data/lib/capillary/commit.rb +6 -1
- data/lib/capillary/version.rb +1 -1
- data/test/capillary/commit_test.rb +6 -1
- metadata +4 -4
data/Gemfile.lock
CHANGED
data/lib/capillary/commit.rb
CHANGED
@@ -21,7 +21,8 @@ require "capillary/ref_collection"
|
|
21
21
|
|
22
22
|
module Capillary
|
23
23
|
class Commit
|
24
|
-
attr_accessor :id, :parent_ids, :committed_at, :
|
24
|
+
attr_accessor :id, :parent_ids, :committed_at, :committer_email, :seq_id
|
25
|
+
attr_writer :message
|
25
26
|
attr_reader :refs
|
26
27
|
LOG_SEPARATOR = "§"
|
27
28
|
|
@@ -63,5 +64,9 @@ module Capillary
|
|
63
64
|
"message" => message,
|
64
65
|
"seqId" => seq_id})
|
65
66
|
end
|
67
|
+
|
68
|
+
def message
|
69
|
+
@message.gsub(/[^A-Za-z0-9\s\'\n\.,\/]/,"")
|
70
|
+
end
|
66
71
|
end
|
67
72
|
end
|
data/lib/capillary/version.rb
CHANGED
@@ -58,12 +58,17 @@ class CommitTest < MiniTest::Spec
|
|
58
58
|
assert_equal JSON.parse(@commit.to_json), {
|
59
59
|
"id" => "a7cf78bfff06d52b5b0aa021508b44c00cad067a",
|
60
60
|
"parentIds" => ["db75ad82d678d51b29709d26af64d4a85b6f8071"],
|
61
|
-
"committedAt" => "Wed Jul 13 07:55:47 +0200 2011",
|
61
|
+
"committedAt" => Time.parse("Wed Jul 13 07:55:47 +0200 2011").to_s,
|
62
62
|
"committerEmail" => "chris@example.com",
|
63
63
|
"refs" => { "heads" => ["master", "refactor"], "tags" => ["v2.0.0"], "remotes" => {} },
|
64
64
|
"message" => "And this is commit 10 Merge branch 'topic'",
|
65
65
|
"seqId" => nil
|
66
66
|
}
|
67
67
|
end
|
68
|
+
|
69
|
+
should "remove HTML tags from output" do
|
70
|
+
@commit.message = '<script>hello</script>'
|
71
|
+
assert_equal "scripthello/script", @commit.message
|
72
|
+
end
|
68
73
|
end
|
69
74
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capillary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 1
|
10
|
+
version: 1.0.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Marius Mathiesen
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date:
|
19
|
+
date: 2012-05-18 00:00:00 +02:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|