mark_maker 0.0.1 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8bb24bb2e32bbaa870a7b0b524a0dbc16b69f3e5
4
- data.tar.gz: 65f61da0c4484b4db65842999babcf162c0eb876
3
+ metadata.gz: 69e37903d222999dbd87778a55fb41e841054995
4
+ data.tar.gz: 5899b79c8427151ed0bb4979546d679a8191e1dc
5
5
  SHA512:
6
- metadata.gz: 369e14792542b8503ff3531fcd7e368f9c88aa3a3f0ec910411d1c088730f14e9a1b9fdc5594906483241b950c7224f89d8b85b26aeac902d27f5391aed1cf7f
7
- data.tar.gz: fd475d7e874233e0083823ffefb649584cc4c711fd52f1ddfddadc2bcb02abda059eb8e4ae04b44a6728b4a86e6abd074a15744204f0b61f09be64c90fc99ecb
6
+ metadata.gz: 560761348ac0f5da4fd4442f070eb57ceed38906b5911a35aaa016c85a572d7abcfbfbefa47bc64ec9fb903b6f7d924916941c1ad498f7c4ad13d90b1db91d1f
7
+ data.tar.gz: aff10b5f78ba18af4f401506445027bbab02ab3c704ad5096a417c32488c959ffa679b93d98bf5f440170873d61f22275d3ab479492c3b71f87eb65e2f1c375e
data/README.md CHANGED
@@ -35,14 +35,33 @@ Produces
35
35
  Let It Begin
36
36
  ============
37
37
 
38
+ ### Bulleted List Example
39
+
40
+ list_content = ['gold', 'silver', 'bronze']
41
+ gen.bullets(*list_content)
42
+
43
+ Produces
44
+
45
+ - gold
46
+ - silver
47
+ - bronze
48
+
49
+ Or a numbered list with...
50
+
51
+ gen.numbers(*list_content)
52
+
53
+ 1. gold
54
+ 2. silver
55
+ 3. bronze
56
+
38
57
  Contributing
39
58
  ------------
40
59
 
41
60
  1. [Fork it](https://github.com/sn1de/mark_maker/fork)
42
- 1. Create your feature branch (`git checkout -b my-new-feature`)
43
- 1. Commit your changes (`git commit -am 'Add some feature'`)
44
- 1. Push to the branch (`git push origin my-new-feature`)
45
- 1. Create a new Pull Request
61
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
62
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
63
+ 4. Push to the branch (`git push origin my-new-feature`)
64
+ 5. Create a new Pull Request
46
65
 
47
66
  About This README
48
67
  -----------------
@@ -54,13 +54,28 @@ doc << gen.code("gen.header1('#{example_header}'')")
54
54
  doc << "\nProduces\n\n"
55
55
  gen.header1(example_header).lines.map { |l| doc << gen.code(l) }
56
56
  doc << ""
57
+ doc << gen.header3("Bulleted List Example")
58
+ list_content = ['gold', 'silver', 'bronze']
59
+ doc << ""
60
+ doc << gen.code("list_content = ['gold', 'silver', 'bronze']")
61
+ doc << gen.code("gen.bullets(*list_content)")
62
+ doc << "\nProduces\n\n"
63
+ doc << gen.bullets(*list_content)
64
+ doc << ""
65
+ doc << "Or a numbered list with..."
66
+ doc << ""
67
+ numbered_code = "gen.numbers(*list_content)"
68
+ doc << gen.code(numbered_code)
69
+ doc << ""
70
+ doc << eval(numbered_code)
71
+ doc << ""
57
72
  doc << gen.header2("Contributing")
58
73
  doc << ""
59
- doc << gen.number(gen.link("Fork it", "https://github.com/sn1de/mark_maker/fork"))
60
- doc << gen.number("Create your feature branch (`git checkout -b my-new-feature`)")
61
- doc << gen.number("Commit your changes (`git commit -am 'Add some feature'`)")
62
- doc << gen.number("Push to the branch (`git push origin my-new-feature`)")
63
- doc << gen.number("Create a new Pull Request")
74
+ doc << gen.numbers(gen.link("Fork it", "https://github.com/sn1de/mark_maker/fork"),
75
+ "Create your feature branch (`git checkout -b my-new-feature`)",
76
+ "Commit your changes (`git commit -am 'Add some feature'`)",
77
+ "Push to the branch (`git push origin my-new-feature`)",
78
+ "Create a new Pull Request")
64
79
  doc << ""
65
80
  doc << gen.header2("About This README")
66
81
  doc << ""
@@ -73,4 +88,4 @@ doc << gen.code("rake readme")
73
88
  doc << ""
74
89
  doc << "I'm calling this Extreme #{gen.link("Readme Driven Development", "http://tom.preston-werner.com/2010/08/23/readme-driven-development.html")}."
75
90
  doc << "It's kind of like #{gen.link("Inception", "http://en.wikipedia.org/wiki/Inception")} ;)"
76
- puts doc
91
+ puts doc
@@ -17,12 +17,26 @@ module MarkMaker
17
17
  def header3(title)
18
18
  "### #{title}"
19
19
  end
20
+
20
21
  def bullet(content)
21
22
  " - #{content}"
22
23
  end
23
24
 
24
- def number(content)
25
- " 1. #{content}"
25
+ def bullets(*content)
26
+ bullet_list = []
27
+ content.each { |li| bullet_list << bullet(li) }
28
+ bullet_list
29
+ end
30
+
31
+ def number(content, number = 1)
32
+ " #{number}. #{content}"
33
+ end
34
+
35
+ def numbers(*content)
36
+ numbered_list = []
37
+ current_number = 0
38
+ content.each { |li| numbered_list << number(li, current_number += 1) }
39
+ numbered_list
26
40
  end
27
41
 
28
42
  def link(label, url)
@@ -1,3 +1,3 @@
1
1
  module MarkMaker
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -37,6 +37,15 @@ class TestMarkMaker < Minitest::Test
37
37
  assert_match(/^ - #{content}$/, markup)
38
38
  end
39
39
 
40
+ def test_bulleted_list_generation
41
+ content = ["gold", "silver", "bronze"]
42
+ gen = MarkMaker::Generator.new
43
+ markup = gen.bullets(*content)
44
+ assert(markup.length == content.length, "The number of lines of content and markup is not equal.")
45
+ content.zip(markup).each do |c, m|
46
+ assert_match(/^\s-\s#{c}$/, m)
47
+ end
48
+ end
40
49
  def test_number_generation
41
50
  content = "Number this line"
42
51
  gen = MarkMaker::Generator.new
@@ -44,6 +53,16 @@ class TestMarkMaker < Minitest::Test
44
53
  assert_match(/^\s\d\.\s#{content}$/, markup)
45
54
  end
46
55
 
56
+ def test_numbered_list_generation
57
+ content = ["1", "2", "3"]
58
+ gen = MarkMaker::Generator.new
59
+ markup = gen.numbers(*content)
60
+ assert(markup.length == content.length, "The number of lines of content and markup is not equal.")
61
+ content.zip(markup).each do |c, m|
62
+ assert_match(/^\s#{c}\.\s#{c}$/, m)
63
+ end
64
+ end
65
+
47
66
  def test_link_generation
48
67
  label = "anywhere"
49
68
  url = "http://www.yahoo.com"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mark_maker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brad Schneider
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-11 00:00:00.000000000 Z
11
+ date: 2015-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler