challah 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/CHANGELOG.md +4 -0
  2. data/lib/challah/version.rb +1 -1
  3. data/lib/tasks/crud.rake +23 -53
  4. data/vendor/bundle/cache/highline-1.6.11.gem +0 -0
  5. data/vendor/bundle/gems/highline-1.6.11/AUTHORS +3 -0
  6. data/vendor/bundle/gems/highline-1.6.11/CHANGELOG +304 -0
  7. data/vendor/bundle/gems/highline-1.6.11/COPYING +340 -0
  8. data/vendor/bundle/gems/highline-1.6.11/INSTALL +55 -0
  9. data/vendor/bundle/gems/highline-1.6.11/LICENSE +7 -0
  10. data/vendor/bundle/gems/highline-1.6.11/README +63 -0
  11. data/vendor/bundle/gems/highline-1.6.11/Rakefile +53 -0
  12. data/vendor/bundle/gems/highline-1.6.11/TODO +6 -0
  13. data/vendor/bundle/gems/highline-1.6.11/examples/ansi_colors.rb +38 -0
  14. data/vendor/bundle/gems/highline-1.6.11/examples/asking_for_arrays.rb +18 -0
  15. data/vendor/bundle/gems/highline-1.6.11/examples/basic_usage.rb +75 -0
  16. data/vendor/bundle/gems/highline-1.6.11/examples/color_scheme.rb +32 -0
  17. data/vendor/bundle/gems/highline-1.6.11/examples/limit.rb +12 -0
  18. data/vendor/bundle/gems/highline-1.6.11/examples/menus.rb +65 -0
  19. data/vendor/bundle/gems/highline-1.6.11/examples/overwrite.rb +19 -0
  20. data/vendor/bundle/gems/highline-1.6.11/examples/page_and_wrap.rb +322 -0
  21. data/vendor/bundle/gems/highline-1.6.11/examples/password.rb +7 -0
  22. data/vendor/bundle/gems/highline-1.6.11/examples/trapping_eof.rb +22 -0
  23. data/vendor/bundle/gems/highline-1.6.11/examples/using_readline.rb +17 -0
  24. data/vendor/bundle/gems/highline-1.6.11/highline.gemspec +36 -0
  25. data/vendor/bundle/gems/highline-1.6.11/lib/highline/color_scheme.rb +136 -0
  26. data/vendor/bundle/gems/highline-1.6.11/lib/highline/compatibility.rb +16 -0
  27. data/vendor/bundle/gems/highline-1.6.11/lib/highline/import.rb +43 -0
  28. data/vendor/bundle/gems/highline-1.6.11/lib/highline/menu.rb +398 -0
  29. data/vendor/bundle/gems/highline-1.6.11/lib/highline/question.rb +465 -0
  30. data/vendor/bundle/gems/highline-1.6.11/lib/highline/string_extensions.rb +98 -0
  31. data/vendor/bundle/gems/highline-1.6.11/lib/highline/style.rb +184 -0
  32. data/vendor/bundle/gems/highline-1.6.11/lib/highline/system_extensions.rb +180 -0
  33. data/vendor/bundle/gems/highline-1.6.11/lib/highline.rb +978 -0
  34. data/vendor/bundle/gems/highline-1.6.11/setup.rb +1360 -0
  35. data/vendor/bundle/gems/highline-1.6.11/site/highline.css +65 -0
  36. data/vendor/bundle/gems/highline-1.6.11/site/images/logo.png +0 -0
  37. data/vendor/bundle/gems/highline-1.6.11/site/index.html +58 -0
  38. data/vendor/bundle/gems/highline-1.6.11/test/string_methods.rb +34 -0
  39. data/vendor/bundle/gems/highline-1.6.11/test/tc_color_scheme.rb +98 -0
  40. data/vendor/bundle/gems/highline-1.6.11/test/tc_highline.rb +962 -0
  41. data/vendor/bundle/gems/highline-1.6.11/test/tc_import.rb +54 -0
  42. data/vendor/bundle/gems/highline-1.6.11/test/tc_menu.rb +429 -0
  43. data/vendor/bundle/gems/highline-1.6.11/test/tc_string_extension.rb +22 -0
  44. data/vendor/bundle/gems/highline-1.6.11/test/tc_string_highline.rb +40 -0
  45. data/vendor/bundle/gems/highline-1.6.11/test/tc_style.rb +569 -0
  46. data/vendor/bundle/gems/highline-1.6.11/test/ts_all.rb +18 -0
  47. data/vendor/bundle/specifications/highline-1.6.11.gemspec +29 -0
  48. metadata +63 -8
@@ -0,0 +1,65 @@
1
+ body {
2
+ margin: 0;
3
+ padding: 0;
4
+ text-align: center;
5
+ background: #abc;
6
+ font: 13px Trebuchet MS, Lucida Sans Unicode, Arial, sans-serif;
7
+ }
8
+
9
+ #container {
10
+ margin: 0 auto;
11
+ margin-top: 10px;
12
+ position: relative;
13
+ width: 785px;
14
+ background: #fff repeat;
15
+ padding-top: 20px;
16
+ }
17
+
18
+ #container #header {
19
+ padding-top: 20px;
20
+ height: 141px;
21
+ width: 785px;
22
+ background: url(images/logo.png) center no-repeat;
23
+ }
24
+
25
+ #container #content {
26
+ text-align: left;
27
+ margin-left: 230px;
28
+ width: 500px;
29
+ }
30
+
31
+ #container #sidebar {
32
+ text-align: left;
33
+ position: absolute;
34
+ top: 181px;
35
+ left: 0;
36
+ width: 170px;
37
+ margin-right: 25px;
38
+ }
39
+
40
+ #container #footer {
41
+ font: 9px Arial;
42
+ padding: 4px;
43
+ border-top: 1px solid;
44
+ color: #aaa;
45
+ }
46
+
47
+ ul {
48
+ list-style: none;
49
+ }
50
+
51
+ li {
52
+ border-bottom: 1px solid #e8e8e8;
53
+ padding-top: 10px;
54
+ }
55
+
56
+ a {
57
+ text-decoration: none;
58
+ color: #15528a;
59
+ }
60
+
61
+ pre {
62
+ padding: 5px;
63
+ padding-left: 20px;
64
+ font: 11px Courier;
65
+ }
@@ -0,0 +1,58 @@
1
+ <html>
2
+ <head>
3
+ <title> HighLine </title>
4
+ <style type="text/css"> @import url(highline.css); </style>
5
+ </head>
6
+ <body>
7
+ <div id="container">
8
+ <div id="header"></div>
9
+ <div id="content">
10
+ <h2>HighLine is about&#8230;</h2>
11
+
12
+
13
+ <h3>Saving time.</h3>
14
+
15
+
16
+ <p>Command line interfaces are meant to be easy. So why shouldn&#8217;t building
17
+ them be easy, too? HighLine provides a solid toolset to help you get
18
+ the job done cleanly so you can focus on the real task at hand,
19
+ <em>your task.</em></p>
20
+
21
+
22
+ <h3>Clean and intuitive design.</h3>
23
+
24
+
25
+ <p>Want to get a taste for how HighLine is used? Take a look at this simple
26
+ example, which asks a user for a zip code, automatically does validation,
27
+ and returns the result:</p>
28
+
29
+
30
+ <pre><code>zip = ask("Zip? ") { |q| q.validate = /\A\d{5}(?:-?\d{4})?\Z/ }</code></pre>
31
+
32
+
33
+ <h3>Hassle-free Installation.</h3>
34
+
35
+
36
+ <p>Installation is easy via RubyGems. Simply enter the command:</p>
37
+
38
+
39
+ <pre><code>sudo gem install highline</code></pre>
40
+
41
+
42
+ <p>and you&#8217;ll be on your way! Of course, manual installation is an option,
43
+ too.</p>
44
+ </div>
45
+ <div id="sidebar">
46
+ <ul>
47
+ <li><a href="http://rubyforge.org/projects/highline">Project Page</a></li>
48
+ <li><a href="http://highline.rubyforge.org/doc">Documentation</a></li>
49
+ <li><a href="https://github.com/JEG2/highline">Source</a></li>
50
+ <li><a href="mailto:james@grayproductions.net">Contact</a></li>
51
+ </ul>
52
+ </div>
53
+ <div id="footer">
54
+ Created by James Edward Gray II and Gregory Brown
55
+ </div>
56
+ </div>
57
+ </body>
58
+ </html>
@@ -0,0 +1,34 @@
1
+ #!/usr/local/bin/ruby -w
2
+
3
+ # string_methods.rb
4
+ #
5
+ # Created by Richard LeBer 2011-06-27
6
+ #
7
+ # This is Free Software. See LICENSE and COPYING for details.
8
+ #
9
+ # String class convenience methods
10
+
11
+ module StringMethods
12
+ def test_color
13
+ assert_equal("\e[34mstring\e[0m", @string.color(:blue))
14
+ assert_equal("\e[1m\e[47mstring\e[0m", @string.color(:bold,:on_white))
15
+ assert_equal("\e[45mstring\e[0m", @string.on(:magenta))
16
+ assert_equal("\e[36mstring\e[0m", @string.cyan)
17
+ assert_equal("\e[41m\e[5mstring\e[0m\e[0m", @string.blink.on_red)
18
+ assert_equal("\e[38;5;137mstring\e[0m", @string.color(:rgb_906030))
19
+ assert_equal("\e[38;5;101mstring\e[0m", @string.rgb('606030'))
20
+ assert_equal("\e[38;5;107mstring\e[0m", @string.rgb('60','90','30'))
21
+ assert_equal("\e[38;5;107mstring\e[0m", @string.rgb(96,144,48))
22
+ assert_equal("\e[38;5;173mstring\e[0m", @string.rgb_c06030)
23
+ assert_equal("\e[48;5;137mstring\e[0m", @string.color(:on_rgb_906030))
24
+ assert_equal("\e[48;5;101mstring\e[0m", @string.on_rgb('606030'))
25
+ assert_equal("\e[48;5;107mstring\e[0m", @string.on_rgb('60','90','30'))
26
+ assert_equal("\e[48;5;107mstring\e[0m", @string.on_rgb(96,144,48))
27
+ assert_equal("\e[48;5;173mstring\e[0m", @string.on_rgb_c06030)
28
+ end
29
+
30
+ def test_uncolor
31
+ colored_string = HighLine::String("\e[38;5;137mstring\e[0m")
32
+ assert_equal "string", colored_string.uncolor
33
+ end
34
+ end
@@ -0,0 +1,98 @@
1
+ #!/usr/local/bin/ruby -w
2
+
3
+ # tc_color_scheme.rb
4
+ #
5
+ # Created by Jeremy Hinegardner on 2007-01-24.
6
+ # Copyright 2007 Jeremy Hinegardner. All rights reserved.
7
+ #
8
+ # This is Free Software. See LICENSE and COPYING for details.
9
+
10
+ require "test/unit"
11
+
12
+ require "highline"
13
+ require "stringio"
14
+
15
+ class TestColorScheme < Test::Unit::TestCase
16
+ def setup
17
+ @input = StringIO.new
18
+ @output = StringIO.new
19
+ @terminal = HighLine.new(@input, @output)
20
+
21
+ @old_color_scheme = HighLine.color_scheme
22
+ end
23
+
24
+ def teardown
25
+ HighLine.color_scheme = @old_color_scheme
26
+ end
27
+
28
+ def test_using_color_scheme
29
+ assert_equal(false,HighLine.using_color_scheme?)
30
+
31
+ HighLine.color_scheme = HighLine::ColorScheme.new
32
+ assert_equal(true,HighLine.using_color_scheme?)
33
+ end
34
+
35
+ def test_scheme
36
+ HighLine.color_scheme = HighLine::SampleColorScheme.new
37
+
38
+ @terminal.say("This should be <%= color('warning yellow', :warning) %>.")
39
+ assert_equal("This should be \e[1m\e[33mwarning yellow\e[0m.\n",@output.string)
40
+ @output.rewind
41
+
42
+ @terminal.say("This should be <%= color('warning yellow', 'warning') %>.")
43
+ assert_equal("This should be \e[1m\e[33mwarning yellow\e[0m.\n",@output.string)
44
+ @output.rewind
45
+
46
+ @terminal.say("This should be <%= color('warning yellow', 'WarNing') %>.")
47
+ assert_equal("This should be \e[1m\e[33mwarning yellow\e[0m.\n",@output.string)
48
+ @output.rewind
49
+
50
+ # Check that keys are available, and as expected
51
+ assert_equal ["critical", "error", "warning", "notice", "info", "debug", "row_even", "row_odd"].sort,
52
+ HighLine.color_scheme.keys.sort
53
+
54
+ # Color scheme doesn't care if we use symbols or strings, and is case-insensitive
55
+ warning1 = HighLine.color_scheme[:warning]
56
+ warning2 = HighLine.color_scheme["warning"]
57
+ warning3 = HighLine.color_scheme[:wArning]
58
+ warning4 = HighLine.color_scheme["warniNg"]
59
+ assert_instance_of HighLine::Style, warning1
60
+ assert_instance_of HighLine::Style, warning2
61
+ assert_instance_of HighLine::Style, warning3
62
+ assert_instance_of HighLine::Style, warning4
63
+ assert_equal warning1, warning2
64
+ assert_equal warning1, warning3
65
+ assert_equal warning1, warning4
66
+
67
+ # Nonexistent keys return nil
68
+ assert_nil HighLine.color_scheme[:nonexistent]
69
+
70
+ # Same as above, for definitions
71
+ defn1 = HighLine.color_scheme.definition(:warning)
72
+ defn2 = HighLine.color_scheme.definition("warning")
73
+ defn3 = HighLine.color_scheme.definition(:wArning)
74
+ defn4 = HighLine.color_scheme.definition("warniNg")
75
+ assert_instance_of Array, defn1
76
+ assert_instance_of Array, defn2
77
+ assert_instance_of Array, defn3
78
+ assert_instance_of Array, defn4
79
+ assert_equal [:bold, :yellow], defn1
80
+ assert_equal [:bold, :yellow], defn2
81
+ assert_equal [:bold, :yellow], defn3
82
+ assert_equal [:bold, :yellow], defn4
83
+ assert_nil HighLine.color_scheme.definition(:nonexistent)
84
+
85
+ color_scheme_hash = HighLine.color_scheme.to_hash
86
+ assert_instance_of Hash, color_scheme_hash
87
+ assert_equal ["critical", "error", "warning", "notice", "info", "debug", "row_even", "row_odd"].sort,
88
+ color_scheme_hash.keys.sort
89
+ assert_instance_of Array, HighLine.color_scheme.definition(:warning)
90
+ assert_equal [:bold, :yellow], HighLine.color_scheme.definition(:warning)
91
+
92
+ # turn it back off, should raise an exception
93
+ HighLine.color_scheme = @old_color_scheme
94
+ assert_raises(NameError) {
95
+ @terminal.say("This should be <%= color('nothing at all', :error) %>.")
96
+ }
97
+ end
98
+ end