m2-helper 0.0.2
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.
- data/LICENSE +20 -0
- data/Manifest +8 -0
- data/README.rdoc +40 -0
- data/Rakefile +14 -0
- data/lib/m2-helper.rb +11 -0
- data/lib/tools/utils.rb +21 -0
- data/m2-helper.gemspec +31 -0
- data/test/m2-helper_test.rb +7 -0
- data/test/test_helper.rb +10 -0
- metadata +85 -0
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Krishna Rokhale
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Manifest
ADDED
data/README.rdoc
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
= m2-helper
|
2
|
+
|
3
|
+
Usage:
|
4
|
+
|
5
|
+
Theme Updater:
|
6
|
+
|
7
|
+
install the gem: ( If this does not work for some reason, get in touch with me! )
|
8
|
+
|
9
|
+
sudo jgem install m2-helper
|
10
|
+
|
11
|
+
log into the console.
|
12
|
+
|
13
|
+
require 'm2-helper'
|
14
|
+
|
15
|
+
M2Helper::Utils.theme_updater("atom-smash-us,atom-smash-intl")
|
16
|
+
|
17
|
+
Can be entered in CSV format, with the first entry ( in this case atom-smash-us) should be the one with the updated theme, the others ( in this case atom-smash-intl) are the permalinks that need to be updated.
|
18
|
+
|
19
|
+
Unless there is an error, it should show "Done".
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
== Note on Patches/Pull Requests
|
28
|
+
|
29
|
+
* Fork the project.
|
30
|
+
* Make your feature addition or bug fix.
|
31
|
+
* Add tests for it. This is important so I don't break it in a
|
32
|
+
future version unintentionally.
|
33
|
+
* Commit, do not mess with rakefile, version, or history.
|
34
|
+
(if you want to have your own version, that is fine but
|
35
|
+
bump version in a commit by itself I can ignore when I pull)
|
36
|
+
* Send me a pull request. Bonus points for topic branches.
|
37
|
+
|
38
|
+
== Copyright
|
39
|
+
|
40
|
+
Copyright (c) 2010 Krishna Rokhale. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'echoe'
|
4
|
+
|
5
|
+
|
6
|
+
Echoe.new('m2-helper', '0.0.2') do |p|
|
7
|
+
p.description = "Helper scripts for m2 store"
|
8
|
+
p.url = "http://m2.sonymusic.com"
|
9
|
+
p.author = "Krishna Rokhale"
|
10
|
+
p.email = "krishna.rokhale.sme@sonymusic.com"
|
11
|
+
p.description = "Helper scripts for m2 store"
|
12
|
+
p.ignore_pattern = ["tmp/*", "script/*"]
|
13
|
+
p.development_dependencies = []
|
14
|
+
end
|
data/lib/m2-helper.rb
ADDED
data/lib/tools/utils.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
module M2Helper
|
2
|
+
|
3
|
+
class Utils
|
4
|
+
|
5
|
+
def self.theme_updater(permalinks)
|
6
|
+
|
7
|
+
links = permalinks.split(",")
|
8
|
+
updated_theme = Store::Base.find_by_permalink(links[0]).themes[0]
|
9
|
+
links.delete_at(0)
|
10
|
+
|
11
|
+
|
12
|
+
links.each do |link|
|
13
|
+
Store::Base.find_by_permalink(link).themes << updated_theme
|
14
|
+
end
|
15
|
+
|
16
|
+
puts "Done!"
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
data/m2-helper.gemspec
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{m2-helper}
|
5
|
+
s.version = "0.0.2"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Krishna Rokhale"]
|
9
|
+
s.date = %q{2010-09-14}
|
10
|
+
s.description = %q{Helper scripts for m2 store}
|
11
|
+
s.email = %q{krishna.rokhale.sme@sonymusic.com}
|
12
|
+
s.extra_rdoc_files = ["LICENSE", "README.rdoc", "lib/m2-helper.rb", "lib/tools/utils.rb"]
|
13
|
+
s.files = ["LICENSE", "Manifest", "README.rdoc", "Rakefile", "lib/m2-helper.rb", "lib/tools/utils.rb", "test/m2-helper_test.rb", "test/test_helper.rb", "m2-helper.gemspec"]
|
14
|
+
s.homepage = %q{http://m2.sonymusic.com}
|
15
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "M2-helper", "--main", "README.rdoc"]
|
16
|
+
s.require_paths = ["lib"]
|
17
|
+
s.rubyforge_project = %q{m2-helper}
|
18
|
+
s.rubygems_version = %q{1.3.7}
|
19
|
+
s.summary = %q{Helper scripts for m2 store}
|
20
|
+
s.test_files = ["test/m2-helper_test.rb", "test/test_helper.rb"]
|
21
|
+
|
22
|
+
if s.respond_to? :specification_version then
|
23
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
24
|
+
s.specification_version = 3
|
25
|
+
|
26
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
27
|
+
else
|
28
|
+
end
|
29
|
+
else
|
30
|
+
end
|
31
|
+
end
|
data/test/test_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: m2-helper
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Krishna Rokhale
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-09-14 00:00:00 -04:00
|
19
|
+
default_executable:
|
20
|
+
dependencies: []
|
21
|
+
|
22
|
+
description: Helper scripts for m2 store
|
23
|
+
email: krishna.rokhale.sme@sonymusic.com
|
24
|
+
executables: []
|
25
|
+
|
26
|
+
extensions: []
|
27
|
+
|
28
|
+
extra_rdoc_files:
|
29
|
+
- LICENSE
|
30
|
+
- README.rdoc
|
31
|
+
- lib/m2-helper.rb
|
32
|
+
- lib/tools/utils.rb
|
33
|
+
files:
|
34
|
+
- LICENSE
|
35
|
+
- Manifest
|
36
|
+
- README.rdoc
|
37
|
+
- Rakefile
|
38
|
+
- lib/m2-helper.rb
|
39
|
+
- lib/tools/utils.rb
|
40
|
+
- test/m2-helper_test.rb
|
41
|
+
- test/test_helper.rb
|
42
|
+
- m2-helper.gemspec
|
43
|
+
has_rdoc: true
|
44
|
+
homepage: http://m2.sonymusic.com
|
45
|
+
licenses: []
|
46
|
+
|
47
|
+
post_install_message:
|
48
|
+
rdoc_options:
|
49
|
+
- --line-numbers
|
50
|
+
- --inline-source
|
51
|
+
- --title
|
52
|
+
- M2-helper
|
53
|
+
- --main
|
54
|
+
- README.rdoc
|
55
|
+
require_paths:
|
56
|
+
- lib
|
57
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
hash: 3
|
63
|
+
segments:
|
64
|
+
- 0
|
65
|
+
version: "0"
|
66
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
|
+
none: false
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
hash: 11
|
72
|
+
segments:
|
73
|
+
- 1
|
74
|
+
- 2
|
75
|
+
version: "1.2"
|
76
|
+
requirements: []
|
77
|
+
|
78
|
+
rubyforge_project: m2-helper
|
79
|
+
rubygems_version: 1.3.7
|
80
|
+
signing_key:
|
81
|
+
specification_version: 3
|
82
|
+
summary: Helper scripts for m2 store
|
83
|
+
test_files:
|
84
|
+
- test/m2-helper_test.rb
|
85
|
+
- test/test_helper.rb
|