trusty-snippets-extension 1.1.0 → 2.0.0.pre.beta
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 +8 -8
- data/Gemfile +2 -0
- data/Gemfile.lock +7 -0
- data/Rakefile +110 -108
- data/app/models/snippet.rb +2 -2
- data/config/trustygems.yml +2 -0
- data/lib/trusty-snippets-extension.rb +1 -1
- data/trusty-snippets-extension.gemspec +1 -1
- metadata +9 -6
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NTQ5YjBjMDYwMzBmYjg2MGU4ZWY2ZTFmMDQ2Y2FlNjhmYjNkNGU4ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Zjg3MGRiNTBhZGFlZDI1MzRjMjg3YWMxZTQ0MmVkZWRlMDA1MTVhNg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTY3MTc0Nzk2MTE5MmFkNDMyNzVlMDFhZmY2ZjEzYmNlNWZlNTI5ZjBmNGU5
|
10
|
+
Nzg1N2FiZjVkNGUxOWQyMTJhNDlkNWVjZjY1ZjcwYjFiMWQ3Mzg4ODc5NGU2
|
11
|
+
OWU1MmFjYTgyZmMxNDAzYzQ5N2YxOTQ1ODllNTI4MDk2MGJmNzE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MGQ2MWVkMmRjNTY0M2Y0YTJjY2U0ZTE2OTZlNTllZTQ2MTI2MTY1OGY3NTk1
|
14
|
+
ZmE2MjA3ZDc1MTNmYzQ4ZGMyMjYxOTkwYzNlNjBhZDhhOWNlZDhmZGI0MGJi
|
15
|
+
Yzk5YzhkYTcyZDQwZmY3YmU5ZTQzOTViNjhkMmRiMDVlZWM3ZjI=
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
data/Rakefile
CHANGED
@@ -1,109 +1,111 @@
|
|
1
|
-
|
2
|
-
unless defined? RADIANT_ROOT
|
3
|
-
ENV["RAILS_ENV"] = "test"
|
4
|
-
case
|
5
|
-
when ENV["RADIANT_ENV_FILE"]
|
6
|
-
require File.dirname(ENV["RADIANT_ENV_FILE"]) + "/boot"
|
7
|
-
when File.dirname(__FILE__) =~ %r{vendor/radiant/vendor/extensions}
|
8
|
-
require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../")}/config/boot"
|
9
|
-
else
|
10
|
-
require "#{File.expand_path(File.dirname(__FILE__) + "/../../../")}/config/boot"
|
11
|
-
end
|
12
|
-
end
|
1
|
+
require 'trustygems'
|
13
2
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
require
|
22
|
-
|
23
|
-
|
24
|
-
#
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
end
|
107
|
-
|
108
|
-
#
|
109
|
-
|
3
|
+
# # Determine where the RSpec plugin is by loading the boot
|
4
|
+
# unless defined? RADIANT_ROOT
|
5
|
+
# ENV["RAILS_ENV"] = "test"
|
6
|
+
# case
|
7
|
+
# when ENV["RADIANT_ENV_FILE"]
|
8
|
+
# require File.dirname(ENV["RADIANT_ENV_FILE"]) + "/boot"
|
9
|
+
# when File.dirname(__FILE__) =~ %r{vendor/radiant/vendor/extensions}
|
10
|
+
# require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../")}/config/boot"
|
11
|
+
# else
|
12
|
+
# require "#{File.expand_path(File.dirname(__FILE__) + "/../../../")}/config/boot"
|
13
|
+
# end
|
14
|
+
# end
|
15
|
+
#
|
16
|
+
# require 'rake'
|
17
|
+
# require 'rdoc/task'
|
18
|
+
# require 'rake/testtask'
|
19
|
+
#
|
20
|
+
# rspec_base = File.expand_path(RADIANT_ROOT + '/vendor/plugins/rspec/lib')
|
21
|
+
# $LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base)
|
22
|
+
# require 'spec/rake/spectask'
|
23
|
+
# require 'cucumber'
|
24
|
+
# require 'cucumber/rake/task'
|
25
|
+
#
|
26
|
+
# # Cleanup the RADIANT_ROOT constant so specs will load the environment
|
27
|
+
# Object.send(:remove_const, :RADIANT_ROOT)
|
28
|
+
#
|
29
|
+
# extension_root = File.expand_path(File.dirname(__FILE__))
|
30
|
+
#
|
31
|
+
# task :default => [:spec, :features]
|
32
|
+
# task :stats => "spec:statsetup"
|
33
|
+
#
|
34
|
+
# desc "Run all specs in spec directory"
|
35
|
+
# Spec::Rake::SpecTask.new(:spec) do |t|
|
36
|
+
# t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
|
37
|
+
# t.spec_files = FileList['spec/**/*_spec.rb']
|
38
|
+
# end
|
39
|
+
#
|
40
|
+
# task :features => 'spec:integration'
|
41
|
+
#
|
42
|
+
# namespace :spec do
|
43
|
+
# desc "Run all specs in spec directory with RCov"
|
44
|
+
# Spec::Rake::SpecTask.new(:rcov) do |t|
|
45
|
+
# t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
|
46
|
+
# t.spec_files = FileList['spec/**/*_spec.rb']
|
47
|
+
# t.rcov = true
|
48
|
+
# t.rcov_opts = ['--exclude', 'spec', '--rails']
|
49
|
+
# end
|
50
|
+
#
|
51
|
+
# desc "Print Specdoc for all specs"
|
52
|
+
# Spec::Rake::SpecTask.new(:doc) do |t|
|
53
|
+
# t.spec_opts = ["--format", "specdoc", "--dry-run"]
|
54
|
+
# t.spec_files = FileList['spec/**/*_spec.rb']
|
55
|
+
# end
|
56
|
+
#
|
57
|
+
# [:models, :controllers, :views, :helpers].each do |sub|
|
58
|
+
# desc "Run the specs under spec/#{sub}"
|
59
|
+
# Spec::Rake::SpecTask.new(sub) do |t|
|
60
|
+
# t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
|
61
|
+
# t.spec_files = FileList["spec/#{sub}/**/*_spec.rb"]
|
62
|
+
# end
|
63
|
+
# end
|
64
|
+
#
|
65
|
+
# desc "Run the Cucumber features"
|
66
|
+
# Cucumber::Rake::Task.new(:integration) do |t|
|
67
|
+
# t.fork = true
|
68
|
+
# t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'pretty')]
|
69
|
+
# # t.feature_pattern = "#{extension_root}/features/**/*.feature"
|
70
|
+
# t.profile = "default"
|
71
|
+
# end
|
72
|
+
#
|
73
|
+
# # Setup specs for stats
|
74
|
+
# task :statsetup do
|
75
|
+
# require 'code_statistics'
|
76
|
+
# ::STATS_DIRECTORIES << %w(Model\ specs spec/models)
|
77
|
+
# ::STATS_DIRECTORIES << %w(View\ specs spec/views)
|
78
|
+
# ::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers)
|
79
|
+
# ::STATS_DIRECTORIES << %w(Helper\ specs spec/views)
|
80
|
+
# ::CodeStatistics::TEST_TYPES << "Model specs"
|
81
|
+
# ::CodeStatistics::TEST_TYPES << "View specs"
|
82
|
+
# ::CodeStatistics::TEST_TYPES << "Controller specs"
|
83
|
+
# ::CodeStatistics::TEST_TYPES << "Helper specs"
|
84
|
+
# ::STATS_DIRECTORIES.delete_if {|a| a[0] =~ /test/}
|
85
|
+
# end
|
86
|
+
#
|
87
|
+
# namespace :db do
|
88
|
+
# namespace :fixtures do
|
89
|
+
# desc "Load fixtures (from spec/fixtures) into the current environment's database. Load specific fixtures using FIXTURES=x,y"
|
90
|
+
# task :load => :environment do
|
91
|
+
# require 'active_record/fixtures'
|
92
|
+
# ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
|
93
|
+
# (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(RAILS_ROOT, 'spec', 'fixtures', '*.{yml,csv}'))).each do |fixture_file|
|
94
|
+
# Fixtures.create_fixtures('spec/fixtures', File.basename(fixture_file, '.*'))
|
95
|
+
# end
|
96
|
+
# end
|
97
|
+
# end
|
98
|
+
# end
|
99
|
+
# end
|
100
|
+
#
|
101
|
+
# desc 'Generate documentation for the snippets extension.'
|
102
|
+
# RDoc::Task.new(:rdoc) do |rdoc|
|
103
|
+
# rdoc.rdoc_dir = 'rdoc'
|
104
|
+
# rdoc.title = 'SnippetsExtension'
|
105
|
+
# rdoc.options << '--line-numbers' << '--inline-source'
|
106
|
+
# rdoc.rdoc_files.include('README')
|
107
|
+
# rdoc.rdoc_files.include('lib/**/*.rb')
|
108
|
+
# end
|
109
|
+
#
|
110
|
+
# # Load any custom rakefiles for extension
|
111
|
+
# Dir[File.dirname(__FILE__) + '/tasks/*.rake'].sort.each { |f| require f }
|
data/app/models/snippet.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
class Snippet < ActiveRecord::Base
|
2
2
|
|
3
3
|
# Default Order
|
4
|
-
default_scope
|
4
|
+
default_scope {order('name')}
|
5
5
|
|
6
6
|
# Associations
|
7
7
|
belongs_to :created_by, :class_name => 'User'
|
@@ -11,7 +11,7 @@ class Snippet < ActiveRecord::Base
|
|
11
11
|
validates_presence_of :name
|
12
12
|
validates_length_of :name, :maximum => 100
|
13
13
|
validates_length_of :filter_id, :maximum => 25, :allow_nil => true
|
14
|
-
validates_format_of :name, :with => %r{
|
14
|
+
validates_format_of :name, :with => %r{\A\S*\z}
|
15
15
|
validates_uniqueness_of :name
|
16
16
|
|
17
17
|
object_id_attr :filter, TextFilter
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trusty-snippets-extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0.pre.beta
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Gay
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-07-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: trusty-cms
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ~>
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: 2.0.0.pre.beta
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ~>
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: 2.0.0.pre.beta
|
28
28
|
description: Makes Trusty better by adding snippets!
|
29
29
|
email:
|
30
30
|
- sipple@trustarts.org
|
@@ -32,6 +32,8 @@ executables: []
|
|
32
32
|
extensions: []
|
33
33
|
extra_rdoc_files: []
|
34
34
|
files:
|
35
|
+
- Gemfile
|
36
|
+
- Gemfile.lock
|
35
37
|
- README.md
|
36
38
|
- Rakefile
|
37
39
|
- app/controllers/admin/snippets_controller.rb
|
@@ -48,6 +50,7 @@ files:
|
|
48
50
|
- config/initializers/radiant_config.rb
|
49
51
|
- config/locales/en.yml
|
50
52
|
- config/routes.rb
|
53
|
+
- config/trustygems.yml
|
51
54
|
- cucumber.yml
|
52
55
|
- features/admin/configuration.feature
|
53
56
|
- features/admin/pagination.feature
|
@@ -86,9 +89,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
86
89
|
version: '0'
|
87
90
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
91
|
requirements:
|
89
|
-
- - ! '
|
92
|
+
- - ! '>'
|
90
93
|
- !ruby/object:Gem::Version
|
91
|
-
version:
|
94
|
+
version: 1.3.1
|
92
95
|
requirements: []
|
93
96
|
rubyforge_project:
|
94
97
|
rubygems_version: 2.4.5
|