virgo 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cac7d1d758a5576955520dde496aead9e0b505d0
4
- data.tar.gz: 94c40df0ab2f2bfa0d50421866144f2fe8fc72b3
3
+ metadata.gz: e6065e134a44f4d05ec90cdbdc6820d8e03f9029
4
+ data.tar.gz: 7a877b8c3b77f8039c6a14750f82342c75057d3a
5
5
  SHA512:
6
- metadata.gz: 3b91fe67d5c46429d59ba65b7f29c308f822c475ec351f4f8d4d6b8ece1fce1e88ed32b0a3677dccd8b963c52acf85b90ce845f4f42ab3006f061ee669de8a7e
7
- data.tar.gz: c1dbde3ded3a61415bf19ccca30943aa032e3be9bf531929ab058089c860085e6973a11b8f3fb5eb33997305502a572529003735e7b7a3aa9b912011e93a5c33
6
+ metadata.gz: e07d45b1b931d81fe66d260743cd897c85fda21911e89f12402c470129ee50a6337ade708dd83b886801eb4253c05379725eca44fb8aada78b6815461b16be6c
7
+ data.tar.gz: ae2b2a750b04a30e059b29846a07745ee85d1760956b259e37f907419dd30b0cf40f4e9017447e58a0dc65db5a56feaa0cc67e9682ac681755fd095e01aebd09
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.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicholas Zaillian
@@ -1012,19 +1012,6 @@ 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
1028
1015
  - spec/controllers/posts_controller_spec.rb
1029
1016
  - spec/data/doge.jpg
1030
1017
  - spec/data/doge2.jpg
@@ -1,20 +0,0 @@
1
- module Virgo
2
- class InstallGenerator < Rails::Generators::Base
3
- def run_install
4
- unless app_has_engine_route?
5
- in_root do
6
- inject_into_file 'config/routes.rb',"\n mount Virgo::Engine => \"/\"\n", { before: /^end/, verbose: false, force: true }
7
- end
8
- end
9
-
10
- generate "virgo:views"
11
- generate "virgo:migrations"
12
- generate "virgo:schedule"
13
- end
14
-
15
- def app_has_engine_route?
16
- route_contents = File.read("#{Rails.root}/config/routes.rb")
17
- route_contents.include?("Virgo::Engine")
18
- end
19
- end
20
- end
@@ -1,19 +0,0 @@
1
- module Virgo
2
- class MigrationsGenerator < Rails::Generators::Base
3
- source_root File.expand_path('../../../../..', __FILE__)
4
-
5
- def copy_migrations
6
- Dir["#{engine_root}/db/migrate/*.rb"].each do |abs_path|
7
- relative_path = abs_path.gsub("#{engine_root}/", '')
8
-
9
- unless File.directory?(abs_path)
10
- copy_file relative_path, relative_path
11
- end
12
- end
13
- end
14
-
15
- def engine_root
16
- File.expand_path('../../../../..', __FILE__)
17
- end
18
- end
19
- end
@@ -1,15 +0,0 @@
1
- module Virgo
2
- class ScheduleGenerator < Rails::Generators::Base
3
- source_root File.expand_path('../../../../..', __FILE__)
4
-
5
- def copy_schedule
6
- abs_path = "#{engine_root}/config/schedule.rb"
7
- relative_path = abs_path.gsub("#{engine_root}/", '')
8
- copy_file relative_path, relative_path
9
- end
10
-
11
- def engine_root
12
- File.expand_path('../../../../..', __FILE__)
13
- end
14
- end
15
- end
@@ -1,22 +0,0 @@
1
- module Virgo
2
- class ViewsGenerator < Rails::Generators::Base
3
- source_root File.expand_path('../../../../..', __FILE__)
4
-
5
- def copy_views
6
- Dir["#{engine_root}/app/views/**/*"].reject { |f|
7
- f.include?('admin') ||
8
- f.include?('shortcode_templates')
9
- }.each do |abs_path|
10
- relative_path = abs_path.gsub("#{engine_root}/", '')
11
-
12
- unless File.directory?(abs_path)
13
- copy_file relative_path, relative_path
14
- end
15
- end
16
- end
17
-
18
- def engine_root
19
- File.expand_path('../../../../..', __FILE__)
20
- end
21
- end
22
- end
@@ -1,7 +0,0 @@
1
- namespace :virgo do
2
- namespace :posts do
3
- task publish_scheduled: :environment do
4
- Virgo::Post.publish_scheduled!
5
- end
6
- end
7
- end
@@ -1,4 +0,0 @@
1
- require "virgo/engine"
2
-
3
- module Virgo
4
- end
@@ -1,6 +0,0 @@
1
- class DevelopmentMailInterceptor
2
- def self.delivering_email(message)
3
- message.subject = "#{message.to} #{message.subject}"
4
- message.to = Rails.application.secrets.mail_intercept_address
5
- end
6
- end
@@ -1,6 +0,0 @@
1
- class EmailValidator < ActiveModel::EachValidator
2
- def validate_each(record, attribute, value)
3
- record.errors.add(attribute, options[:message] || "has an invalid format") unless
4
- value =~ /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i
5
- end
6
- end
@@ -1,64 +0,0 @@
1
- module Virgo
2
- class Engine < ::Rails::Engine
3
- isolate_namespace Virgo
4
-
5
- config.autoload_paths << File.expand_path("..", __FILE__)
6
-
7
- config.caching = :aggressive
8
-
9
- config.require_posts_to_have_category = false
10
-
11
- config.domain = 'localhost'
12
-
13
- config.edit_lock_timeout = 8.seconds
14
-
15
- config.edit_lock_grace = 10.seconds
16
-
17
- config.post_locking_enabled = true
18
-
19
- config.deploy_key = Digest::MD5.hexdigest(Dir["#{Rails.root}/public/assets/**/*"].join(':'))
20
-
21
- # some dependencies must be explicitly required if used in an engine...
22
- require 'devise'
23
- require 'kaminari-bootstrap'
24
- require 'friendly_id'
25
- require 'kaminari'
26
- require 'kaminari-bootstrap'
27
- require 'carrierwave'
28
- require 'cancan'
29
- require 'handles_sortable_columns'
30
- require 'action_controller/action_caching.rb'
31
- require 'htmlentities'
32
- require 'jquery-rails'
33
- require 'jquery-ui-rails'
34
- require 'jquery-fileupload-rails'
35
- require 'bootstrap-sass'
36
- require 'font-awesome-sass'
37
- require 'bootstrap3-datetimepicker-rails'
38
- require 'select2-rails'
39
- require 'momentjs-rails'
40
- require 'local_time'
41
- require 'tinymce-rails'
42
- require 'chronic'
43
-
44
- require File.expand_path("../../../vendor/gems/shortcode/lib/shortcode", __FILE__)
45
-
46
-
47
- spec = Gem::Specification.find_by_name("local_time")
48
- gem_root = spec.gem_dir
49
- require "#{gem_root}/app/helpers/local_time_helper"
50
-
51
- ActionView::Base.send :include, ::LocalTimeHelper
52
-
53
- config.to_prepare do
54
- # Load application's model / class decorators
55
- Dir["#{Rails.root}/app/**/*_decorator*.rb"].each do |c|
56
- Rails.configuration.cache_classes ? require(c) : load(c)
57
- end
58
- end
59
-
60
- config.generators do |g|
61
- g.test_framework :rspec
62
- end
63
- end
64
- end
@@ -1,6 +0,0 @@
1
- class ReduceValidator < ActiveModel::EachValidator
2
- def validate_each(record, attribute, value)
3
- return until record.errors.has_key?(attribute)
4
- record.errors[attribute].slice!(-1) until record.errors[attribute].size <= 1
5
- end
6
- end
@@ -1,89 +0,0 @@
1
- # encoding: utf-8
2
- require 'digest/sha1'
3
- require 'mime/types'
4
-
5
- module UploadHelpers
6
- module Http
7
- # Create tempfile from hash
8
- class UploadedFile
9
- attr_accessor :original_filename, :content_type, :tempfile, :headers
10
-
11
- def initialize(hash)
12
- @original_filename = hash[:filename]
13
- @content_type = hash[:type]
14
- @headers = hash[:head]
15
- @tempfile = hash[:tempfile]
16
- raise(ArgumentError, ':tempfile is required') unless @tempfile
17
- end
18
-
19
- def open
20
- @tempfile.open
21
- end
22
-
23
- def path
24
- @tempfile.path
25
- end
26
-
27
- def read(*args)
28
- @tempfile.read(*args)
29
- end
30
-
31
- def rewind
32
- @tempfile.rewind
33
- end
34
-
35
- def size
36
- @tempfile.size
37
- end
38
- end
39
-
40
- # Usage (paperclip example)
41
- # @asset.data = QqFile.new(params[:qqfile], request)
42
- class QqFile < ::Tempfile
43
-
44
- def initialize(filename, request, tmpdir = Dir::tmpdir)
45
- @original_filename = filename
46
- @request = request
47
-
48
- super Digest::SHA1.hexdigest(filename), tmpdir
49
- fetch
50
- end
51
-
52
- def fetch
53
- self.write(body)
54
- self.rewind
55
- self
56
- end
57
-
58
- def original_filename
59
- @original_filename
60
- end
61
-
62
- def content_type
63
- types = MIME::Types.type_for(original_filename)
64
- types.empty? ? @request.content_type : types.first.to_s
65
- end
66
-
67
- def body
68
- if @request.raw_post.respond_to?(:force_encoding)
69
- @request.raw_post.force_encoding("UTF-8")
70
- else
71
- @request.raw_post
72
- end
73
- end
74
- end
75
-
76
- # Convert nested Hash to HashWithIndifferentAccess and replace
77
- # file upload hash with UploadedFile objects
78
- def self.normalize_param(*args)
79
- value = args.first
80
- if Hash === value && value.has_key?(:tempfile)
81
- UploadedFile.new(value)
82
- elsif value.is_a?(String)
83
- QqFile.new(*args)
84
- else
85
- value
86
- end
87
- end
88
- end
89
- end
@@ -1,3 +0,0 @@
1
- module Virgo
2
- VERSION = "0.1.2"
3
- end
@@ -1,3 +0,0 @@
1
- class ViewHelp
2
- include ActionView::Helpers::SanitizeHelper, ActionView::Helpers::TextHelper
3
- end