bcms_tools 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Rakefile +13 -12
- data/VERSION +1 -1
- data/bcms_tools.gemspec +30 -36
- data/lib/bcms_tools/migration_helpers.rb +54 -49
- metadata +66 -95
- data/.gitignore +0 -5
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 14d3a121525dc2fcb3b382f48696da17388bc117
|
4
|
+
data.tar.gz: 3efaaaed1a07ffda2eefe0ab6965b2bf91970f16
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d501c0359bc5e3c803deeb8d4e2803abed69f2b35638caf1cf54b082852a27e4a5aa01f088d7c72a38f7d7e6a047dd25addfe51c9150ee8a7e0a3b1e5175bf8b
|
7
|
+
data.tar.gz: 8be35c5e80cd02f1621c295ccfcb9da530f29b2676223a8cbb766248f4bbe86f64c551b87a6cf3fdfcf2175c5981985a930ba50d00ee99d9098f3b7dd6a5ade2
|
data/Rakefile
CHANGED
@@ -48,16 +48,17 @@ task :test => :check_dependencies
|
|
48
48
|
|
49
49
|
task :default => :test
|
50
50
|
|
51
|
-
require 'rake/rdoctask'
|
52
|
-
Rake::RDocTask.new do |rdoc|
|
53
|
-
if File.exist?('VERSION')
|
54
|
-
version = File.read('VERSION')
|
55
|
-
else
|
56
|
-
version = ""
|
57
|
-
end
|
51
|
+
#require 'rake/rdoctask'
|
52
|
+
#Rake::RDocTask.new do |rdoc|
|
53
|
+
# if File.exist?('VERSION')
|
54
|
+
# version = File.read('VERSION')
|
55
|
+
# else
|
56
|
+
# version = ""
|
57
|
+
# end
|
58
|
+
#
|
59
|
+
# rdoc.rdoc_dir = 'rdoc'
|
60
|
+
# rdoc.title = "bcms_tools #{version}"
|
61
|
+
# rdoc.rdoc_files.include('README*')
|
62
|
+
# rdoc.rdoc_files.include('lib/**/*.rb')
|
63
|
+
#end
|
58
64
|
|
59
|
-
rdoc.rdoc_dir = 'rdoc'
|
60
|
-
rdoc.title = "bcms_tools #{version}"
|
61
|
-
rdoc.rdoc_files.include('README*')
|
62
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
63
|
-
end
|
data/VERSION
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.8
|
2
2
|
|
data/bcms_tools.gemspec
CHANGED
@@ -1,56 +1,50 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: bcms_tools 0.2.8 ruby lib
|
5
6
|
|
6
7
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
-
s.version = "0.2.
|
8
|
+
s.name = "bcms_tools"
|
9
|
+
s.version = "0.2.8"
|
9
10
|
|
10
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib"]
|
11
13
|
s.authors = ["buzzware"]
|
12
|
-
s.date =
|
13
|
-
s.description =
|
14
|
-
s.email =
|
14
|
+
s.date = "2014-12-15"
|
15
|
+
s.description = "Tools for BrowserCms."
|
16
|
+
s.email = "contact@buzzware.com.au"
|
15
17
|
s.extra_rdoc_files = [
|
16
18
|
"LICENSE",
|
17
|
-
|
19
|
+
"README.rdoc"
|
18
20
|
]
|
19
21
|
s.files = [
|
20
22
|
".document",
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
"rails/init.rb",
|
38
|
-
"test/bcms_tools_test.rb",
|
39
|
-
"test/test_helper.rb"
|
40
|
-
]
|
41
|
-
s.homepage = %q{http://github.com/buzzware/bcms_tools}
|
42
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
43
|
-
s.require_paths = ["lib"]
|
44
|
-
s.rubygems_version = %q{1.3.7}
|
45
|
-
s.summary = %q{Tools for BrowserCms.}
|
46
|
-
s.test_files = [
|
23
|
+
"LICENSE",
|
24
|
+
"README.rdoc",
|
25
|
+
"Rakefile",
|
26
|
+
"VERSION",
|
27
|
+
"bcms_tools.gemspec",
|
28
|
+
"bcms_tools.vpj",
|
29
|
+
"bcms_tools.vpw",
|
30
|
+
"lib/bcms_tools.rb",
|
31
|
+
"lib/bcms_tools/bcms_thumbnails.rb",
|
32
|
+
"lib/bcms_tools/category_utils.rb",
|
33
|
+
"lib/bcms_tools/form_helpers.rb",
|
34
|
+
"lib/bcms_tools/migration_helpers.rb",
|
35
|
+
"lib/bcms_tools/view_helpers.rb",
|
36
|
+
"lib/bcms_tools_dev.rb",
|
37
|
+
"public/stylesheets/bcms_tools.css",
|
38
|
+
"rails/init.rb",
|
47
39
|
"test/bcms_tools_test.rb",
|
48
|
-
|
40
|
+
"test/test_helper.rb"
|
49
41
|
]
|
42
|
+
s.homepage = "http://github.com/buzzware/bcms_tools"
|
43
|
+
s.rubygems_version = "2.2.2"
|
44
|
+
s.summary = "Tools for BrowserCms."
|
50
45
|
|
51
46
|
if s.respond_to? :specification_version then
|
52
|
-
|
53
|
-
s.specification_version = 3
|
47
|
+
s.specification_version = 4
|
54
48
|
|
55
49
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
56
50
|
s.add_runtime_dependency(%q<buzzcore>, [">= 0.3.2"])
|
@@ -3,60 +3,65 @@
|
|
3
3
|
|
4
4
|
# The following makes InnoDB the default format for tables for browsercms methods
|
5
5
|
# that use create_table_from_definition eg. create_content_table and create_versioned_table
|
6
|
-
ActiveRecord::ConnectionAdapters::MysqlAdapter.class_eval do
|
7
|
-
alias :orig_create_table_from_definition :create_table_from_definition
|
8
|
-
def create_table_from_definition(table_name, options, table_definition)
|
9
|
-
if !options || !options[:options] || !options[:options].index(/ENGINE/i)
|
10
|
-
options ||= {}
|
11
|
-
if options[:options]
|
12
|
-
options[:options] = options[:options] + "\nENGINE = InnoDB"
|
13
|
-
else
|
14
|
-
options[:options] = "ENGINE = InnoDB"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
orig_create_table_from_definition(table_name,options,table_definition)
|
18
|
-
end
|
19
|
-
end
|
20
6
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
#class ConvertAllToInnodb < ActiveRecord::Migration
|
34
|
-
# def self.up
|
35
|
-
# convert_database_to_innodb()
|
36
|
-
# end
|
37
|
-
#
|
38
|
-
# def self.down
|
39
|
-
# end
|
40
|
-
#end
|
41
|
-
|
42
|
-
def get_isam_tables(aDatabase=nil)
|
43
|
-
aDatabase ||= ActiveRecord::Base.connection.current_database
|
44
|
-
isam_tables = []
|
45
|
-
ActiveRecord::Base.connection.execute("SELECT table_name FROM information_schema.tables WHERE engine = 'MyISAM' and table_schema = '#{aDatabase}';").each {|s| isam_tables << s}
|
46
|
-
isam_tables
|
47
|
-
end
|
48
|
-
|
49
|
-
def convert_tables_to_innodb(aTables,aDatabase=nil)
|
50
|
-
aDatabase ||= ActiveRecord::Base.connection.current_database
|
51
|
-
aTables.each {|t| ActiveRecord::Base.connection.execute("ALTER TABLE #{aDatabase}.#{t} engine=InnoDB;")}
|
7
|
+
if defined? ActiveRecord::ConnectionAdapters::MysqlAdapter
|
8
|
+
|
9
|
+
ActiveRecord::ConnectionAdapters::MysqlAdapter.class_eval do
|
10
|
+
alias :orig_create_table_from_definition :create_table_from_definition
|
11
|
+
def create_table_from_definition(table_name, options, table_definition)
|
12
|
+
if !options || !options[:options] || !options[:options].index(/ENGINE/i)
|
13
|
+
options ||= {}
|
14
|
+
if options[:options]
|
15
|
+
options[:options] = options[:options] + "\nENGINE = InnoDB"
|
16
|
+
else
|
17
|
+
options[:options] = "ENGINE = InnoDB"
|
18
|
+
end
|
52
19
|
end
|
20
|
+
orig_create_table_from_definition(table_name,options,table_definition)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
module ActiveRecord
|
25
|
+
module ConnectionAdapters
|
26
|
+
module SchemaStatements
|
53
27
|
|
54
|
-
|
55
|
-
|
56
|
-
|
28
|
+
#The following methods and migration will convert all
|
29
|
+
# MyISAM tables to InnoDB format.
|
30
|
+
#
|
31
|
+
# Also see https://browsermedia.lighthouseapp.com/projects/28481-browsercms-30/tickets/319-custom-migrations-methods-eg-create_content_table-result-in-myisam-tables
|
32
|
+
#
|
33
|
+
# example migration :
|
34
|
+
#gem 'bcms_tools'; require 'bcms_tools'
|
35
|
+
#
|
36
|
+
#class ConvertAllToInnodb < ActiveRecord::Migration
|
37
|
+
# def self.up
|
38
|
+
# convert_database_to_innodb()
|
39
|
+
# end
|
40
|
+
#
|
41
|
+
# def self.down
|
42
|
+
# end
|
43
|
+
#end
|
44
|
+
|
45
|
+
def get_isam_tables(aDatabase=nil)
|
46
|
+
aDatabase ||= ActiveRecord::Base.connection.current_database
|
47
|
+
isam_tables = []
|
48
|
+
ActiveRecord::Base.connection.execute("SELECT table_name FROM information_schema.tables WHERE engine = 'MyISAM' and table_schema = '#{aDatabase}';").each {|s| isam_tables << s}
|
49
|
+
isam_tables
|
50
|
+
end
|
51
|
+
|
52
|
+
def convert_tables_to_innodb(aTables,aDatabase=nil)
|
53
|
+
aDatabase ||= ActiveRecord::Base.connection.current_database
|
54
|
+
aTables.each {|t| ActiveRecord::Base.connection.execute("ALTER TABLE #{aDatabase}.#{t} engine=InnoDB;")}
|
55
|
+
end
|
56
|
+
|
57
|
+
# aDatabase may be nil to use the current database
|
58
|
+
def convert_database_to_innodb(aDatabase=nil)
|
59
|
+
convert_tables_to_innodb(get_isam_tables(aDatabase),aDatabase)
|
60
|
+
end
|
61
|
+
|
57
62
|
end
|
58
|
-
|
59
63
|
end
|
60
64
|
end
|
65
|
+
|
61
66
|
end
|
62
67
|
|
metadata
CHANGED
@@ -1,96 +1,80 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: bcms_tools
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease: false
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
- 7
|
10
|
-
version: 0.2.7
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.8
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- buzzware
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2014-12-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
22
14
|
name: buzzcore
|
23
|
-
|
24
|
-
|
25
|
-
none: false
|
26
|
-
requirements:
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
27
17
|
- - ">="
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 23
|
30
|
-
segments:
|
31
|
-
- 0
|
32
|
-
- 3
|
33
|
-
- 2
|
18
|
+
- !ruby/object:Gem::Version
|
34
19
|
version: 0.3.2
|
35
20
|
type: :runtime
|
36
|
-
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: paperclip
|
39
21
|
prerelease: false
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.3.2
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: paperclip
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '='
|
32
|
+
- !ruby/object:Gem::Version
|
51
33
|
version: 2.3.1.1
|
52
34
|
type: :runtime
|
53
|
-
version_requirements: *id002
|
54
|
-
- !ruby/object:Gem::Dependency
|
55
|
-
name: browsercms
|
56
35
|
prerelease: false
|
57
|
-
|
58
|
-
|
59
|
-
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 2.3.1.1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: browsercms
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
60
45
|
- - ">="
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
|
63
|
-
segments:
|
64
|
-
- 0
|
65
|
-
version: "0"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
66
48
|
type: :runtime
|
67
|
-
version_requirements: *id003
|
68
|
-
- !ruby/object:Gem::Dependency
|
69
|
-
name: shoulda
|
70
49
|
prerelease: false
|
71
|
-
|
72
|
-
|
73
|
-
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: shoulda
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
74
59
|
- - ">="
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
|
77
|
-
segments:
|
78
|
-
- 0
|
79
|
-
version: "0"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
80
62
|
type: :development
|
81
|
-
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
82
69
|
description: Tools for BrowserCms.
|
83
70
|
email: contact@buzzware.com.au
|
84
71
|
executables: []
|
85
|
-
|
86
72
|
extensions: []
|
87
|
-
|
88
|
-
extra_rdoc_files:
|
73
|
+
extra_rdoc_files:
|
89
74
|
- LICENSE
|
90
75
|
- README.rdoc
|
91
|
-
files:
|
92
|
-
- .document
|
93
|
-
- .gitignore
|
76
|
+
files:
|
77
|
+
- ".document"
|
94
78
|
- LICENSE
|
95
79
|
- README.rdoc
|
96
80
|
- Rakefile
|
@@ -109,40 +93,27 @@ files:
|
|
109
93
|
- rails/init.rb
|
110
94
|
- test/bcms_tools_test.rb
|
111
95
|
- test/test_helper.rb
|
112
|
-
has_rdoc: true
|
113
96
|
homepage: http://github.com/buzzware/bcms_tools
|
114
97
|
licenses: []
|
115
|
-
|
98
|
+
metadata: {}
|
116
99
|
post_install_message:
|
117
|
-
rdoc_options:
|
118
|
-
|
119
|
-
require_paths:
|
100
|
+
rdoc_options: []
|
101
|
+
require_paths:
|
120
102
|
- lib
|
121
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
122
|
-
|
123
|
-
requirements:
|
103
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
104
|
+
requirements:
|
124
105
|
- - ">="
|
125
|
-
- !ruby/object:Gem::Version
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
version: "0"
|
130
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
|
-
none: false
|
132
|
-
requirements:
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '0'
|
108
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
|
+
requirements:
|
133
110
|
- - ">="
|
134
|
-
- !ruby/object:Gem::Version
|
135
|
-
|
136
|
-
segments:
|
137
|
-
- 0
|
138
|
-
version: "0"
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: '0'
|
139
113
|
requirements: []
|
140
|
-
|
141
114
|
rubyforge_project:
|
142
|
-
rubygems_version:
|
115
|
+
rubygems_version: 2.2.2
|
143
116
|
signing_key:
|
144
|
-
specification_version:
|
117
|
+
specification_version: 4
|
145
118
|
summary: Tools for BrowserCms.
|
146
|
-
test_files:
|
147
|
-
- test/bcms_tools_test.rb
|
148
|
-
- test/test_helper.rb
|
119
|
+
test_files: []
|