code2gist 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/code2gist.gemspec +1 -1
- data/lib/code2gist.rb +2 -2
- data/test/code2gist_test.rb +5 -0
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/code2gist.gemspec
CHANGED
data/lib/code2gist.rb
CHANGED
@@ -5,7 +5,7 @@ require "json"
|
|
5
5
|
module Code2Gist
|
6
6
|
extend self
|
7
7
|
|
8
|
-
CODE_REGEX = /```(\w+\.\w+)?[^\n]*\n(.*?)```/m
|
8
|
+
CODE_REGEX = /```((?:\s*)\w+\.\w+)?[^\n]*\n(.*?)```/m
|
9
9
|
|
10
10
|
module Config
|
11
11
|
def self.github_login
|
@@ -52,7 +52,7 @@ module Code2Gist
|
|
52
52
|
|
53
53
|
def name_nameless_code_blocks(text)
|
54
54
|
nameless_blocks = 0
|
55
|
-
new_text = text.gsub(/```(\w+\.\w+)?/).with_index do |match, index|
|
55
|
+
new_text = text.gsub(/```((?:\s*)\w+\.\w+)?/).with_index do |match, index|
|
56
56
|
if index%2 == 0 && match.size == 3
|
57
57
|
nameless_blocks += 1;
|
58
58
|
"```untitled_#{nameless_blocks}.txt"
|
data/test/code2gist_test.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: code2gist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-08-
|
12
|
+
date: 2011-08-23 00:00:00.000000000Z
|
13
13
|
dependencies: []
|
14
14
|
description: Parse text files (markdown/textile/whatever) for code blocks and gist
|
15
15
|
them
|
@@ -42,7 +42,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
42
42
|
version: '0'
|
43
43
|
segments:
|
44
44
|
- 0
|
45
|
-
hash:
|
45
|
+
hash: -3615808291212224038
|
46
46
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
47
47
|
none: false
|
48
48
|
requirements:
|