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,46 @@
1
+ require 'spec_helper'
2
+
3
+ describe "template parsers" do
4
+
5
+ let(:simple_quote) { load_fixture :simple_quote }
6
+ let(:simple_quote_output) { load_fixture :simple_quote_output, :html }
7
+
8
+ context "erb" do
9
+
10
+ it "can render a template" do
11
+ expect(Shortcode.process(simple_quote).gsub("\n",'')).to eq(simple_quote_output)
12
+ end
13
+
14
+ end
15
+
16
+ context "haml" do
17
+
18
+ before(:each) do
19
+ Shortcode.setup do |config|
20
+ config.template_parser = :haml
21
+ config.template_paths = [File.join(File.dirname(__FILE__), "support/templates/haml")]
22
+ end
23
+ end
24
+
25
+ it "can render a template" do
26
+ expect(Shortcode.process(simple_quote).gsub("\n",'')).to eq(simple_quote_output)
27
+ end
28
+
29
+ end
30
+
31
+ context "slim" do
32
+
33
+ before(:each) do
34
+ Shortcode.setup do |config|
35
+ config.template_parser = :slim
36
+ config.template_paths = [File.join(File.dirname(__FILE__), "support/templates/slim")]
37
+ end
38
+ end
39
+
40
+ it "can render a template" do
41
+ expect(Shortcode.process(simple_quote).gsub("\n",'')).to eq(simple_quote_output)
42
+ end
43
+
44
+ end
45
+
46
+ end
@@ -0,0 +1,122 @@
1
+ require 'spec_helper'
2
+ require 'parslet/rig/rspec'
3
+ require 'pp'
4
+
5
+ describe Shortcode do
6
+
7
+ let(:parser) { Shortcode::Parser.new }
8
+ let(:transformer) { Shortcode::Transformer.new }
9
+
10
+ let(:simple_quote) { load_fixture :simple_quote }
11
+ let(:full_quote) { load_fixture :full_quote }
12
+ let(:quote_with_extras) { load_fixture :quote_with_extras }
13
+ let(:simple_list) { load_fixture :simple_list }
14
+ let(:timeline_event) { load_fixture :timeline_event }
15
+ let(:timeline_info) { load_fixture :timeline_info }
16
+ let(:timeline_person) { load_fixture :timeline_person }
17
+ let(:complex_snippet) { load_fixture :complex_snippet }
18
+ let(:block_with_whitespace) { load_fixture :block_with_whitespace }
19
+
20
+ let(:quotes) { [simple_quote, full_quote, quote_with_extras] }
21
+ let(:collapsible_lists) { [simple_list] }
22
+ let(:timelines) { [timeline_event, timeline_info, timeline_person] }
23
+
24
+ let(:simple_quote_output) { load_fixture :simple_quote_output, :html }
25
+ let(:full_quote_output) { load_fixture :full_quote_output, :html }
26
+ let(:quote_with_extras_output) { load_fixture :quote_with_extras_output, :html }
27
+ let(:simple_list_output) { load_fixture :simple_list_output, :html }
28
+ let(:timeline_event_output) { load_fixture :timeline_event_output, :html }
29
+ let(:timeline_info_output) { load_fixture :timeline_info_output, :html }
30
+ let(:timeline_person_output) { load_fixture :timeline_person_output, :html }
31
+ let(:complex_snippet_output) { load_fixture :complex_snippet_output, :html }
32
+ let(:block_with_whitespace_output) { load_fixture :block_with_whitespace_output, :html }
33
+
34
+ context "simple_quote" do
35
+
36
+ it "converts into html" do
37
+ obj = parser.parse(simple_quote)
38
+ html = transformer.apply obj, additional_attributes: nil
39
+ expect(html.gsub("\n", '')).to eq(simple_quote_output)
40
+ end
41
+
42
+ end
43
+
44
+ context "full_quote" do
45
+
46
+ it "converts into html" do
47
+ html = transformer.apply(parser.parse(full_quote), additional_attributes: nil)
48
+ expect(html.gsub("\n", '')).to eq(full_quote_output)
49
+ end
50
+
51
+ end
52
+
53
+ context "quote_with_extras" do
54
+
55
+ it "converts into html" do
56
+ html = transformer.apply(parser.parse(quote_with_extras), additional_attributes: nil)
57
+ expect(html.gsub("\n", '')).to eq(quote_with_extras_output)
58
+ end
59
+
60
+ end
61
+
62
+ context "simple_list" do
63
+
64
+ it "converts into html" do
65
+ html = transformer.apply(parser.parse(simple_list), additional_attributes: nil)
66
+ expect(html.gsub("\n", '')).to eq(simple_list_output)
67
+ end
68
+
69
+ end
70
+
71
+ context "timeline_event" do
72
+
73
+ it "converts into html" do
74
+ html = transformer.apply(parser.parse(timeline_event), additional_attributes: nil)
75
+ expect(html.gsub("\n", '')).to eq(timeline_event_output)
76
+ end
77
+
78
+ end
79
+
80
+ context "timeline_info" do
81
+
82
+ it "converts into html" do
83
+ html = transformer.apply(parser.parse(timeline_info), additional_attributes: nil)
84
+ expect(html.gsub("\n", '')).to eq(timeline_info_output)
85
+ end
86
+
87
+ end
88
+
89
+ context "timeline_person" do
90
+
91
+ it "converts into html" do
92
+ html = transformer.apply(parser.parse(timeline_person), additional_attributes: nil)
93
+ expect(html.gsub("\n", '')).to eq(timeline_person_output)
94
+ end
95
+
96
+ end
97
+
98
+ context "complex_snippet" do
99
+
100
+ it "converts into html" do
101
+ html = transformer.apply(parser.parse(complex_snippet), additional_attributes: nil)
102
+ expect(html.gsub("\n", '')).to eq(complex_snippet_output)
103
+ end
104
+ end
105
+
106
+ context "erb templates" do
107
+
108
+ it "converts into html" do
109
+ html = transformer.apply(parser.parse(simple_quote), additional_attributes: nil)
110
+ expect(html.gsub("\n",'')).to eq(simple_quote_output)
111
+ end
112
+ end
113
+
114
+ context 'whitespace' do
115
+
116
+ it 'is preserved after a block tag' do
117
+ html = transformer.apply(parser.parse(block_with_whitespace), additional_attributes: nil)
118
+ expect(html.gsub("\n",'')).to eq(block_with_whitespace_output)
119
+ end
120
+
121
+ end
122
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: virgo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicholas Zaillian
@@ -1012,6 +1012,19 @@ files:
1012
1012
  - config/routes.rb
1013
1013
  - config/schedule.rb
1014
1014
  - db/migrate/20150729174510_create_virgo_schema.rb
1015
+ - lib/generators/virgo/install/install_generator.rb
1016
+ - lib/generators/virgo/migrations/migrations_generator.rb
1017
+ - lib/generators/virgo/schedule/schedule_generator.rb
1018
+ - lib/generators/virgo/views/views_generator.rb
1019
+ - lib/tasks/virgo_tasks.rake
1020
+ - lib/virgo.rb
1021
+ - lib/virgo/development_mail_interceptor.rb
1022
+ - lib/virgo/email_validator.rb
1023
+ - lib/virgo/engine.rb
1024
+ - lib/virgo/reduce_validator.rb
1025
+ - lib/virgo/upload_helpers.rb
1026
+ - lib/virgo/version.rb
1027
+ - lib/virgo/view_help.rb
1015
1028
  - spec/controllers/posts_controller_spec.rb
1016
1029
  - spec/data/doge.jpg
1017
1030
  - spec/data/doge2.jpg
@@ -1995,6 +2008,89 @@ files:
1995
2008
  - spec/spec_helper.rb
1996
2009
  - spec/support/capybara.rb
1997
2010
  - spec/support/capybara_common.rb
2011
+ - vendor/gems/shortcode/Appraisals
2012
+ - vendor/gems/shortcode/CHANGELOG.md
2013
+ - vendor/gems/shortcode/Gemfile
2014
+ - vendor/gems/shortcode/Gemfile.lock
2015
+ - vendor/gems/shortcode/LICENSE.txt
2016
+ - vendor/gems/shortcode/README.md
2017
+ - vendor/gems/shortcode/Rakefile
2018
+ - vendor/gems/shortcode/gemfiles/rails_3.2.gemfile
2019
+ - vendor/gems/shortcode/gemfiles/rails_4.0.gemfile
2020
+ - vendor/gems/shortcode/gemfiles/rails_4.1.gemfile
2021
+ - vendor/gems/shortcode/gemfiles/rails_4.2.gemfile
2022
+ - vendor/gems/shortcode/lib/shortcode.rb
2023
+ - vendor/gems/shortcode/lib/shortcode/configuration.rb
2024
+ - vendor/gems/shortcode/lib/shortcode/exceptions.rb
2025
+ - vendor/gems/shortcode/lib/shortcode/parser.rb
2026
+ - vendor/gems/shortcode/lib/shortcode/presenter.rb
2027
+ - vendor/gems/shortcode/lib/shortcode/processor.rb
2028
+ - vendor/gems/shortcode/lib/shortcode/railtie.rb
2029
+ - vendor/gems/shortcode/lib/shortcode/tag.rb
2030
+ - vendor/gems/shortcode/lib/shortcode/template_binding.rb
2031
+ - vendor/gems/shortcode/lib/shortcode/transformer.rb
2032
+ - vendor/gems/shortcode/lib/shortcode/version.rb
2033
+ - vendor/gems/shortcode/shortcode.gemspec
2034
+ - vendor/gems/shortcode/spec/parser_spec.rb
2035
+ - vendor/gems/shortcode/spec/performance_spec.rb
2036
+ - vendor/gems/shortcode/spec/presenter_spec.rb
2037
+ - vendor/gems/shortcode/spec/rails_helpers_spec.rb
2038
+ - vendor/gems/shortcode/spec/shortcode_spec.rb
2039
+ - vendor/gems/shortcode/spec/spec_helper.rb
2040
+ - vendor/gems/shortcode/spec/support/fixtures.rb
2041
+ - vendor/gems/shortcode/spec/support/fixtures/block_with_whitespace.txt
2042
+ - vendor/gems/shortcode/spec/support/fixtures/block_with_whitespace_output.html
2043
+ - vendor/gems/shortcode/spec/support/fixtures/complex_snippet.txt
2044
+ - vendor/gems/shortcode/spec/support/fixtures/complex_snippet_output.html
2045
+ - vendor/gems/shortcode/spec/support/fixtures/custom_helper.txt
2046
+ - vendor/gems/shortcode/spec/support/fixtures/custom_helper_output.html
2047
+ - vendor/gems/shortcode/spec/support/fixtures/full_quote.txt
2048
+ - vendor/gems/shortcode/spec/support/fixtures/full_quote_output.html
2049
+ - vendor/gems/shortcode/spec/support/fixtures/item.txt
2050
+ - vendor/gems/shortcode/spec/support/fixtures/item_presenter_attributes_output.html
2051
+ - vendor/gems/shortcode/spec/support/fixtures/item_presenter_output.html
2052
+ - vendor/gems/shortcode/spec/support/fixtures/long_text.txt
2053
+ - vendor/gems/shortcode/spec/support/fixtures/quote_with_extras.txt
2054
+ - vendor/gems/shortcode/spec/support/fixtures/quote_with_extras_output.html
2055
+ - vendor/gems/shortcode/spec/support/fixtures/rails_helper.txt
2056
+ - vendor/gems/shortcode/spec/support/fixtures/rails_helper_output_erb.html
2057
+ - vendor/gems/shortcode/spec/support/fixtures/rails_helper_output_haml.html
2058
+ - vendor/gems/shortcode/spec/support/fixtures/rails_helper_output_slim.html
2059
+ - vendor/gems/shortcode/spec/support/fixtures/simple_list.txt
2060
+ - vendor/gems/shortcode/spec/support/fixtures/simple_list_output.html
2061
+ - vendor/gems/shortcode/spec/support/fixtures/simple_quote.txt
2062
+ - vendor/gems/shortcode/spec/support/fixtures/simple_quote_output.html
2063
+ - vendor/gems/shortcode/spec/support/fixtures/simple_quote_presenter_attributes_output.html
2064
+ - vendor/gems/shortcode/spec/support/fixtures/simple_quote_presenter_output.html
2065
+ - vendor/gems/shortcode/spec/support/fixtures/timeline_event.txt
2066
+ - vendor/gems/shortcode/spec/support/fixtures/timeline_event_output.html
2067
+ - vendor/gems/shortcode/spec/support/fixtures/timeline_info.txt
2068
+ - vendor/gems/shortcode/spec/support/fixtures/timeline_info_output.html
2069
+ - vendor/gems/shortcode/spec/support/fixtures/timeline_person.txt
2070
+ - vendor/gems/shortcode/spec/support/fixtures/timeline_person_output.html
2071
+ - vendor/gems/shortcode/spec/support/fixtures/without_quotes.txt
2072
+ - vendor/gems/shortcode/spec/support/presenters/missing_attributes_presenter.rb
2073
+ - vendor/gems/shortcode/spec/support/presenters/missing_content_presenter.rb
2074
+ - vendor/gems/shortcode/spec/support/presenters/missing_for_presenter.rb
2075
+ - vendor/gems/shortcode/spec/support/presenters/missing_initialize_presenter.rb
2076
+ - vendor/gems/shortcode/spec/support/presenters/multiple_presenter.rb
2077
+ - vendor/gems/shortcode/spec/support/presenters/my_presenter.rb
2078
+ - vendor/gems/shortcode/spec/support/presenters/other_presenter.rb
2079
+ - vendor/gems/shortcode/spec/support/templates/erb/collapsible_list.html.erb
2080
+ - vendor/gems/shortcode/spec/support/templates/erb/custom_helper.html.erb
2081
+ - vendor/gems/shortcode/spec/support/templates/erb/item.html.erb
2082
+ - vendor/gems/shortcode/spec/support/templates/erb/quote.html.erb
2083
+ - vendor/gems/shortcode/spec/support/templates/erb/rails_helper.html.erb
2084
+ - vendor/gems/shortcode/spec/support/templates/erb/timeline_event.html.erb
2085
+ - vendor/gems/shortcode/spec/support/templates/erb/timeline_info.html.erb
2086
+ - vendor/gems/shortcode/spec/support/templates/erb/timeline_person.html.erb
2087
+ - vendor/gems/shortcode/spec/support/templates/haml/quote.html.haml
2088
+ - vendor/gems/shortcode/spec/support/templates/haml/rails_helper.html.haml
2089
+ - vendor/gems/shortcode/spec/support/templates/slim/quote.html.slim
2090
+ - vendor/gems/shortcode/spec/support/templates/slim/rails_helper.html.slim
2091
+ - vendor/gems/shortcode/spec/tag_spec.rb
2092
+ - vendor/gems/shortcode/spec/template_parsers_spec.rb
2093
+ - vendor/gems/shortcode/spec/transformer_spec.rb
1998
2094
  homepage: http://caspersleep.github.io/Virgo
1999
2095
  licenses:
2000
2096
  - GPL v2