virgo 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generators/virgo/install/install_generator.rb +20 -0
  3. data/lib/generators/virgo/migrations/migrations_generator.rb +19 -0
  4. data/lib/generators/virgo/schedule/schedule_generator.rb +15 -0
  5. data/lib/generators/virgo/views/views_generator.rb +22 -0
  6. data/lib/tasks/virgo_tasks.rake +7 -0
  7. data/lib/virgo.rb +4 -0
  8. data/lib/virgo/development_mail_interceptor.rb +6 -0
  9. data/lib/virgo/email_validator.rb +6 -0
  10. data/lib/virgo/engine.rb +64 -0
  11. data/lib/virgo/reduce_validator.rb +6 -0
  12. data/lib/virgo/upload_helpers.rb +89 -0
  13. data/lib/virgo/version.rb +3 -0
  14. data/lib/virgo/view_help.rb +3 -0
  15. data/vendor/gems/shortcode/Appraisals +15 -0
  16. data/vendor/gems/shortcode/CHANGELOG.md +162 -0
  17. data/vendor/gems/shortcode/Gemfile +6 -0
  18. data/vendor/gems/shortcode/Gemfile.lock +168 -0
  19. data/vendor/gems/shortcode/LICENSE.txt +22 -0
  20. data/vendor/gems/shortcode/README.md +268 -0
  21. data/vendor/gems/shortcode/Rakefile +3 -0
  22. data/vendor/gems/shortcode/gemfiles/rails_3.2.gemfile +8 -0
  23. data/vendor/gems/shortcode/gemfiles/rails_4.0.gemfile +8 -0
  24. data/vendor/gems/shortcode/gemfiles/rails_4.1.gemfile +8 -0
  25. data/vendor/gems/shortcode/gemfiles/rails_4.2.gemfile +8 -0
  26. data/vendor/gems/shortcode/lib/shortcode.rb +53 -0
  27. data/vendor/gems/shortcode/lib/shortcode/configuration.rb +36 -0
  28. data/vendor/gems/shortcode/lib/shortcode/exceptions.rb +9 -0
  29. data/vendor/gems/shortcode/lib/shortcode/parser.rb +43 -0
  30. data/vendor/gems/shortcode/lib/shortcode/presenter.rb +49 -0
  31. data/vendor/gems/shortcode/lib/shortcode/processor.rb +17 -0
  32. data/vendor/gems/shortcode/lib/shortcode/railtie.rb +3 -0
  33. data/vendor/gems/shortcode/lib/shortcode/tag.rb +54 -0
  34. data/vendor/gems/shortcode/lib/shortcode/template_binding.rb +33 -0
  35. data/vendor/gems/shortcode/lib/shortcode/transformer.rb +17 -0
  36. data/vendor/gems/shortcode/lib/shortcode/version.rb +3 -0
  37. data/vendor/gems/shortcode/shortcode.gemspec +30 -0
  38. data/vendor/gems/shortcode/spec/parser_spec.rb +267 -0
  39. data/vendor/gems/shortcode/spec/performance_spec.rb +41 -0
  40. data/vendor/gems/shortcode/spec/presenter_spec.rb +126 -0
  41. data/vendor/gems/shortcode/spec/rails_helpers_spec.rb +72 -0
  42. data/vendor/gems/shortcode/spec/shortcode_spec.rb +57 -0
  43. data/vendor/gems/shortcode/spec/spec_helper.rb +32 -0
  44. data/vendor/gems/shortcode/spec/support/fixtures.rb +9 -0
  45. data/vendor/gems/shortcode/spec/support/fixtures/block_with_whitespace.txt +2 -0
  46. data/vendor/gems/shortcode/spec/support/fixtures/block_with_whitespace_output.html +2 -0
  47. data/vendor/gems/shortcode/spec/support/fixtures/complex_snippet.txt +13 -0
  48. data/vendor/gems/shortcode/spec/support/fixtures/complex_snippet_output.html +33 -0
  49. data/vendor/gems/shortcode/spec/support/fixtures/custom_helper.txt +1 -0
  50. data/vendor/gems/shortcode/spec/support/fixtures/custom_helper_output.html +1 -0
  51. data/vendor/gems/shortcode/spec/support/fixtures/full_quote.txt +1 -0
  52. data/vendor/gems/shortcode/spec/support/fixtures/full_quote_output.html +7 -0
  53. data/vendor/gems/shortcode/spec/support/fixtures/item.txt +1 -0
  54. data/vendor/gems/shortcode/spec/support/fixtures/item_presenter_attributes_output.html +4 -0
  55. data/vendor/gems/shortcode/spec/support/fixtures/item_presenter_output.html +4 -0
  56. data/vendor/gems/shortcode/spec/support/fixtures/long_text.txt +39 -0
  57. data/vendor/gems/shortcode/spec/support/fixtures/quote_with_extras.txt +1 -0
  58. data/vendor/gems/shortcode/spec/support/fixtures/quote_with_extras_output.html +7 -0
  59. data/vendor/gems/shortcode/spec/support/fixtures/rails_helper.txt +1 -0
  60. data/vendor/gems/shortcode/spec/support/fixtures/rails_helper_output_erb.html +1 -0
  61. data/vendor/gems/shortcode/spec/support/fixtures/rails_helper_output_haml.html +1 -0
  62. data/vendor/gems/shortcode/spec/support/fixtures/rails_helper_output_slim.html +1 -0
  63. data/vendor/gems/shortcode/spec/support/fixtures/simple_list.txt +5 -0
  64. data/vendor/gems/shortcode/spec/support/fixtures/simple_list_output.html +15 -0
  65. data/vendor/gems/shortcode/spec/support/fixtures/simple_quote.txt +1 -0
  66. data/vendor/gems/shortcode/spec/support/fixtures/simple_quote_output.html +3 -0
  67. data/vendor/gems/shortcode/spec/support/fixtures/simple_quote_presenter_attributes_output.html +6 -0
  68. data/vendor/gems/shortcode/spec/support/fixtures/simple_quote_presenter_output.html +6 -0
  69. data/vendor/gems/shortcode/spec/support/fixtures/timeline_event.txt +1 -0
  70. data/vendor/gems/shortcode/spec/support/fixtures/timeline_event_output.html +15 -0
  71. data/vendor/gems/shortcode/spec/support/fixtures/timeline_info.txt +1 -0
  72. data/vendor/gems/shortcode/spec/support/fixtures/timeline_info_output.html +14 -0
  73. data/vendor/gems/shortcode/spec/support/fixtures/timeline_person.txt +4 -0
  74. data/vendor/gems/shortcode/spec/support/fixtures/timeline_person_output.html +23 -0
  75. data/vendor/gems/shortcode/spec/support/fixtures/without_quotes.txt +1 -0
  76. data/vendor/gems/shortcode/spec/support/presenters/missing_attributes_presenter.rb +12 -0
  77. data/vendor/gems/shortcode/spec/support/presenters/missing_content_presenter.rb +12 -0
  78. data/vendor/gems/shortcode/spec/support/presenters/missing_for_presenter.rb +12 -0
  79. data/vendor/gems/shortcode/spec/support/presenters/missing_initialize_presenter.rb +12 -0
  80. data/vendor/gems/shortcode/spec/support/presenters/multiple_presenter.rb +19 -0
  81. data/vendor/gems/shortcode/spec/support/presenters/my_presenter.rb +19 -0
  82. data/vendor/gems/shortcode/spec/support/presenters/other_presenter.rb +19 -0
  83. data/vendor/gems/shortcode/spec/support/templates/erb/collapsible_list.html.erb +3 -0
  84. data/vendor/gems/shortcode/spec/support/templates/erb/custom_helper.html.erb +1 -0
  85. data/vendor/gems/shortcode/spec/support/templates/erb/item.html.erb +4 -0
  86. data/vendor/gems/shortcode/spec/support/templates/erb/quote.html.erb +13 -0
  87. data/vendor/gems/shortcode/spec/support/templates/erb/rails_helper.html.erb +1 -0
  88. data/vendor/gems/shortcode/spec/support/templates/erb/timeline_event.html.erb +17 -0
  89. data/vendor/gems/shortcode/spec/support/templates/erb/timeline_info.html.erb +15 -0
  90. data/vendor/gems/shortcode/spec/support/templates/erb/timeline_person.html.erb +23 -0
  91. data/vendor/gems/shortcode/spec/support/templates/haml/quote.html.haml +8 -0
  92. data/vendor/gems/shortcode/spec/support/templates/haml/rails_helper.html.haml +1 -0
  93. data/vendor/gems/shortcode/spec/support/templates/slim/quote.html.slim +8 -0
  94. data/vendor/gems/shortcode/spec/support/templates/slim/rails_helper.html.slim +1 -0
  95. data/vendor/gems/shortcode/spec/tag_spec.rb +67 -0
  96. data/vendor/gems/shortcode/spec/template_parsers_spec.rb +46 -0
  97. data/vendor/gems/shortcode/spec/transformer_spec.rb +122 -0
  98. metadata +97 -1
@@ -0,0 +1 @@
1
+ Blah blah [quote author="Jamie Dyer"]A quote[/quote] <br> blah blah
@@ -0,0 +1,7 @@
1
+ Blah blah <blockquote>
2
+ <p class='quotation'>A quote</p>
3
+ <p class='citation'>
4
+ <span class='author'>Jamie Dyer</span>
5
+ </p>
6
+ </blockquote>
7
+ <br> blah blah
@@ -0,0 +1 @@
1
+ [rails_helper]blah[/rails_helper]
@@ -0,0 +1,5 @@
1
+ [collapsible_list]
2
+ [item title="Example title 1"]Example content 1[/item]
3
+ [item title="Example title 2"]Example content 2[/item]
4
+ [item title="Example title 3"]Example content 3[/item]
5
+ [/collapsible_list]
@@ -0,0 +1,15 @@
1
+ <div class='collapsible'>
2
+ <section>
3
+ <h5>Example title 1</h5>
4
+ <div>Example content 1</div>
5
+ </section>
6
+ <section>
7
+ <h5>Example title 2</h5>
8
+ <div>Example content 2</div>
9
+ </section>
10
+ <section>
11
+ <h5>Example title 3</h5>
12
+ <div>Example content 3</div>
13
+ </section>
14
+
15
+ </div>
@@ -0,0 +1 @@
1
+ [quote]hello[/quote]
@@ -0,0 +1,3 @@
1
+ <blockquote>
2
+ <p class='quotation'>hello</p>
3
+ </blockquote>
@@ -0,0 +1,6 @@
1
+ <blockquote>
2
+ <p class='quotation'>hello</p>
3
+ <p class='citation'>
4
+ <span class='position'>Additional attribute title</span>
5
+ </p>
6
+ </blockquote>
@@ -0,0 +1,6 @@
1
+ <blockquote>
2
+ <p class='quotation'>hello</p>
3
+ <p class='citation'>
4
+ <span class='position'>my custom title</span>
5
+ </p>
6
+ </blockquote>
@@ -0,0 +1 @@
1
+ [timeline_event date="March 2013" title="a title" link="http://blah.com"]
@@ -0,0 +1,15 @@
1
+ <div class='timeline'>
2
+ <table>
3
+ <tbody>
4
+ <tr>
5
+ <th scope='row'>
6
+ March 2013
7
+ </th>
8
+ <td class='event'>
9
+ <span class='description'>a title</span>
10
+ <a class='read_more' href='http://blah.com'>Read More</a>
11
+ </td>
12
+ </tr>
13
+ </tbody>
14
+ </table>
15
+ </div>
@@ -0,0 +1 @@
1
+ [timeline_info date="Feb 2013" title="Something amazing"]
@@ -0,0 +1,14 @@
1
+ <div class='timeline'>
2
+ <table>
3
+ <tbody>
4
+ <tr>
5
+ <th scope='row'>
6
+ Feb 2013
7
+ </th>
8
+ <td class='information'>
9
+ <p>Something amazing</p>
10
+ </td>
11
+ </tr>
12
+ </tbody>
13
+ </table>
14
+ </div>
@@ -0,0 +1,4 @@
1
+ [timeline_person date="Jan 2012" title="A real title" image="/images/person.jpg" name="Sam Smith" position="Presedent" link="http://blah.com"]
2
+ A bit of body copy
3
+ with a newline
4
+ [/timeline_person]
@@ -0,0 +1,23 @@
1
+ <div class='timeline'>
2
+ <table>
3
+ <tbody>
4
+ <tr>
5
+ <th scope='row'>
6
+ Jan 2012
7
+ </th>
8
+ <td class='team_news'>
9
+ <img src='/images/person.jpg'>
10
+ <h4>A real title</h4>
11
+ <span class='name'>Sam Smith</span>
12
+ <span class='position'>Presedent</span>
13
+ <a class='read_more' href='http://blah.com'>View Profile</a>
14
+ <div class='description'>
15
+ <p>A bit of body copy
16
+ with a newline
17
+ </p>
18
+ </div>
19
+ </td>
20
+ </tr>
21
+ </tbody>
22
+ </table>
23
+ </div>
@@ -0,0 +1 @@
1
+ [quote author="Jamie Dyer" title=King_of_England]A quote[/quote]
@@ -0,0 +1,12 @@
1
+ class MissingAttributesPresenter
2
+
3
+ def initialize
4
+ end
5
+
6
+ def self.for
7
+ end
8
+
9
+ def content
10
+ end
11
+
12
+ end
@@ -0,0 +1,12 @@
1
+ class MissingContentPresenter
2
+
3
+ def initialize
4
+ end
5
+
6
+ def self.for
7
+ end
8
+
9
+ def attributes
10
+ end
11
+
12
+ end
@@ -0,0 +1,12 @@
1
+ class MissingForPresenter
2
+
3
+ def initialize
4
+ end
5
+
6
+ def content
7
+ end
8
+
9
+ def attributes
10
+ end
11
+
12
+ end
@@ -0,0 +1,12 @@
1
+ class MissingInitializePresenter
2
+
3
+ def self.for
4
+ end
5
+
6
+ def content
7
+ end
8
+
9
+ def attributes
10
+ end
11
+
12
+ end
@@ -0,0 +1,19 @@
1
+ class MultiplePresenter
2
+
3
+ def self.for
4
+ [:quote, :item]
5
+ end
6
+
7
+ def initialize(attributes, content, additional_attributes)
8
+ @content = content
9
+ @additional_attributes = additional_attributes
10
+ end
11
+
12
+ def content
13
+ @content
14
+ end
15
+
16
+ def attributes
17
+ @additional_attributes || { title: "my custom title" }
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ class MyPresenter
2
+
3
+ def self.for
4
+ :quote
5
+ end
6
+
7
+ def initialize(attributes, content, additional_attributes)
8
+ @content = content
9
+ @additional_attributes = additional_attributes
10
+ end
11
+
12
+ def content
13
+ @content
14
+ end
15
+
16
+ def attributes
17
+ @additional_attributes || { title: "my custom title" }
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ class OtherPresenter
2
+
3
+ def self.for
4
+ :other
5
+ end
6
+
7
+ def initialize(attributes, content, additional_attributes)
8
+ @content = content
9
+ @additional_attributes = additional_attributes
10
+ end
11
+
12
+ def content
13
+ @content
14
+ end
15
+
16
+ def attributes
17
+ @additional_attributes || { title: "my custom title" }
18
+ end
19
+ end
@@ -0,0 +1,3 @@
1
+ <div class='collapsible'>
2
+ <%= @content %>
3
+ </div>
@@ -0,0 +1 @@
1
+ <%= wrap_in_p(@content) %>
@@ -0,0 +1,4 @@
1
+ <section>
2
+ <h5><%= @attributes[:title] %></h5>
3
+ <div><%= @content %></div>
4
+ </section>
@@ -0,0 +1,13 @@
1
+ <blockquote>
2
+ <p class='quotation'><%= @content %></p>
3
+ <% if @attributes[:author] || @attributes[:title] %>
4
+ <p class='citation'>
5
+ <% if @attributes[:author] %>
6
+ <span class='author'><%= @attributes[:author] %></span>
7
+ <% end %>
8
+ <% if @attributes[:title] %>
9
+ <span class='position'><%= @attributes[:title] %></span>
10
+ <% end %>
11
+ </p>
12
+ <% end %>
13
+ </blockquote>
@@ -0,0 +1 @@
1
+ <%= content_tag(:b, @content) %>
@@ -0,0 +1,17 @@
1
+ <div class='timeline'>
2
+ <table>
3
+ <tbody>
4
+ <tr>
5
+ <th scope='row'>
6
+ <%= @attributes[:date] %>
7
+ </th>
8
+ <td class='event'>
9
+ <span class='description'><%= @attributes[:title] %></span>
10
+ <% if @attributes[:link] %>
11
+ <a class='read_more' href='<%= @attributes[:link] %>'>Read More</a>
12
+ <% end %>
13
+ </td>
14
+ </tr>
15
+ </tbody>
16
+ </table>
17
+ </div>
@@ -0,0 +1,15 @@
1
+ <div class='timeline'>
2
+ <table>
3
+ <tbody>
4
+ <tr>
5
+ <th scope='row'>
6
+ <%= @attributes[:date] %>
7
+ </th>
8
+ <td class='information'>
9
+ <p><%= @attributes[:title] %></p>
10
+ </td>
11
+ </tr>
12
+ </tbody>
13
+ </table>
14
+ </div>
15
+
@@ -0,0 +1,23 @@
1
+ <div class='timeline'>
2
+ <table>
3
+ <tbody>
4
+ <tr>
5
+ <th scope='row'>
6
+ <%= @attributes[:date] %>
7
+ </th>
8
+ <td class='team_news'>
9
+ <img src='<%= @attributes[:image] %>'>
10
+ <h4><%= @attributes[:title] %></h4>
11
+ <span class='name'><%= @attributes[:name] %></span>
12
+ <span class='position'><%= @attributes[:position] %></span>
13
+ <% if @attributes[:link] %>
14
+ <a class='read_more' href='<%= @attributes[:link] %>'>View Profile</a>
15
+ <% end %>
16
+ <div class='description'>
17
+ <p><%= @content %></p>
18
+ </div>
19
+ </td>
20
+ </tr>
21
+ </tbody>
22
+ </table>
23
+ </div>
@@ -0,0 +1,8 @@
1
+ %blockquote
2
+ %p.quotation= @content
3
+ -if @attributes[:author] || @attributes[:title]
4
+ %p.citation
5
+ -if @attributes[:author]
6
+ %span.author= @attributes[:author]
7
+ -if @attributes[:title]
8
+ %span.position= @attributes[:title]
@@ -0,0 +1 @@
1
+ = content_tag(:p, @content)
@@ -0,0 +1,8 @@
1
+ blockquote
2
+ p.quotation = @content
3
+ -if @attributes[:author] || @attributes[:title]
4
+ p.citation
5
+ -if @attributes[:author]
6
+ span.author = @attributes[:author]
7
+ -if @attributes[:title]
8
+ span.position = @attributes[:title]
@@ -0,0 +1 @@
1
+ = content_tag :i, @content
@@ -0,0 +1,67 @@
1
+ require 'spec_helper'
2
+
3
+ describe Shortcode::Tag do
4
+
5
+ context "when the template file is missing" do
6
+
7
+ let(:tag) { Shortcode::Tag.new('doesnt_exist') }
8
+
9
+ it "raises a TemplateNotFound error when the file doesn't exists" do
10
+ expect { tag.render }.to raise_error(Shortcode::TemplateNotFound)
11
+ end
12
+
13
+ end
14
+
15
+ context "when an unsupported template parser is specified" do
16
+
17
+ let(:tag) { Shortcode::Tag.new('quote') }
18
+
19
+ before(:each) do
20
+ Shortcode.setup do |config|
21
+ config.template_parser = :something_crazy
22
+ end
23
+ end
24
+
25
+ it "raises a TemplateNotFound error when the file doesn't exists" do
26
+ expect { tag.render }.to raise_error(Shortcode::TemplateParserNotSupported)
27
+ end
28
+
29
+ end
30
+
31
+ context "templates from strings" do
32
+
33
+ let(:tag) { Shortcode::Tag.new('from_string', [{ key: 'string', value: 'batman' }]) }
34
+
35
+ before(:each) do
36
+ Shortcode.setup do |config|
37
+ config.templates = {
38
+ from_string: '<p><%= @attributes[:string] %></p>'
39
+ }
40
+ end
41
+ end
42
+
43
+ it "renders a template from a string" do
44
+ expect(tag.render).to eq('<p>batman</p>')
45
+ end
46
+
47
+ end
48
+
49
+ context "when the template is missing from the config" do
50
+
51
+ let(:tag) { Shortcode::Tag.new('missing', [{ key: 'string', value: 'batman' }]) }
52
+
53
+ before(:each) do
54
+ Shortcode.setup do |config|
55
+ config.templates = {
56
+ from_string: '<p><%= @attributes[:string] %></p>'
57
+ }
58
+ end
59
+ end
60
+
61
+ it "raises an error" do
62
+ expect { tag.render }.to raise_error(Shortcode::TemplateNotFound)
63
+ end
64
+
65
+ end
66
+
67
+ end