rake-tools 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6573f0a117c91dd3c5f0f67054b87bcb8195017a
4
+ data.tar.gz: 68afe9c82dcdb3525fae8a31fae96ae9aa59c9e8
5
+ SHA512:
6
+ metadata.gz: ae392126b5e0ca2cea7e85aa0f3fed4888dbf3558ce6a3f99e0d0e25921c3200cd3a36a6abc1fe66c8c583151d18c46418b6b33a82c3f20a1c6ccb258c188a5e
7
+ data.tar.gz: 9185ef8e72b304ca2da08cdffcbf3f3fe30d9e6956401bdf458d5b9c9f818630149293c387e4a5609510c9024cad137ed529f0db9b89ff5e6cb3dc52377faeed
@@ -0,0 +1,2 @@
1
+ .idea
2
+ *.gem
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 VJ Patel
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1,2 @@
1
+ # rake-build-gem
2
+ A Ruby Gem to use with a pre-defined set of tasks when building with Rake
@@ -0,0 +1,12 @@
1
+ class Composer
2
+
3
+ def self.development
4
+ puts '---- Running development Composer installation'
5
+ fail 'Composer development installation failed' unless system 'composer install --verbose --profile'
6
+ end
7
+
8
+ def self.production
9
+ puts '---- Running production Composer installation'
10
+ fail 'Composer production installation failed' unless system 'composer install --no-dev --optimize-autoloader --no-interaction --verbose --profile'
11
+ end
12
+ end
@@ -0,0 +1,20 @@
1
+ class Npm
2
+
3
+ def self.global(packages)
4
+ if packages.length > 0
5
+ packages.each do |package|
6
+ puts "Installing #{package} globally"
7
+ fail "Failed to install #{package}" unless system "sudo npm install -g #{package}"
8
+ end
9
+ end
10
+ end
11
+
12
+ def self.install
13
+ puts 'Failed to install npm dependencies' unless system 'sudo npm install'
14
+ end
15
+
16
+ def self.bower_install
17
+ puts 'Failed to install bower components' unless system 'bower install'
18
+ end
19
+
20
+ end
@@ -0,0 +1,24 @@
1
+ class RakeTools
2
+
3
+ def self.composer
4
+ Composer
5
+ end
6
+
7
+ def self.symfony
8
+ Symfony
9
+ end
10
+
11
+ def self.npm
12
+ Npm
13
+ end
14
+
15
+ def self.test
16
+ Test
17
+ end
18
+
19
+ end
20
+
21
+ require 'composer'
22
+ require 'symfony/symfony'
23
+ require 'npm/npm'
24
+ require 'test/test'
@@ -0,0 +1,32 @@
1
+ class Doctrine
2
+
3
+ def self.create_database
4
+ puts '---- Creating Database'
5
+ fail 'Database creation failed!' unless /(exists|Created)/.match(`app/console doctrine:database:create`)
6
+ end
7
+
8
+ def self.run_migrations
9
+ puts '---- Running Migrations'
10
+ fail 'Migrations failed!' unless system 'app/console doctrine:migrations:migrate -n'
11
+ end
12
+
13
+ def self.clear_metadata_cache
14
+ puts '---- Clearing Metadata Cache'
15
+ fail 'Clearing metadata cache failed' unless system 'app/console doctrine:cache:clear-metadata'
16
+ end
17
+
18
+ def self.clear_query_cache
19
+ puts '---- Clearing Query Cache'
20
+ fail 'Clearing query cache failed' unless system 'app/console doctrine:cache:clear-query'
21
+ end
22
+
23
+ def self.clear_result_cache
24
+ puts '---- Clearing Result Cache'
25
+ fail 'Clearing result cache failed' unless system 'app/console doctrine:cache:clear-result'
26
+ end
27
+
28
+ def self.ensure_production
29
+ puts '---- Ensuring database has production settings'
30
+ fail 'Database is not in production' unless system 'app/console doctrine:ensure-production-settings'
31
+ end
32
+ end
@@ -0,0 +1,19 @@
1
+ class FosOAuth
2
+
3
+ def self.add_test_key
4
+ puts '----> Adding Development/Testing OAUTH Client Key'
5
+ fail 'Query failed!' unless system 'app/console doctrine:query:sql "
6
+ INSERT INTO
7
+ oauth_client (id, random_id, redirect_uris, secret, allowed_grant_types)
8
+ VALUES (
9
+ 1,
10
+ \"TEST_KEY\",
11
+ \"a:0:{}\",
12
+ \"TEST_KEY\",
13
+ \"a:4:{i:0;s:8:"password";i:1;s:18:"authorization_code";i:2;s:13:"refresh-token";i:3;s:5:"token";}\")
14
+ ON DUPLICATE KEY
15
+ UPDATE random_id=\"TEST_KEY\", secret=\"TEST_KEY\"";
16
+ '
17
+ end
18
+
19
+ end
@@ -0,0 +1,41 @@
1
+ class Symfony
2
+
3
+ def self.doctrine
4
+ Doctrine
5
+ end
6
+
7
+ def self.fos_oauth
8
+ FosOAuth
9
+ end
10
+
11
+ def self.security_check
12
+ puts '---- Running SensioLabs bundle security checker'
13
+ fail 'Security check failed!' unless system 'app/console security:check'
14
+ end
15
+
16
+ def self.code_sniffer
17
+ puts '---- Getting latest SensioLabs Code Sniffer'
18
+ fail 'Failed fetching the code sniffer!' unless system 'curl http://get.sensiolabs.org/php-cs-fixer.phar -o php-cs-fixer'
19
+ fail 'Coding standards failed!' unless system 'php php-cs-fixer fix src/ --dry-run'
20
+ fail 'Clean up failed!' unless system 'rm php-cs-fixer'
21
+ end
22
+
23
+ def self.cache_warm(environment)
24
+ puts '---- Warming the Symfony Cache'
25
+ fail 'Failed to warm the Symfony Cache' unless system "app/console cache:warm -e #{environment}"
26
+ end
27
+
28
+ def self.cache_clear(environment)
29
+ puts '---- Warming the Symfony Cache'
30
+ fail 'Failed to warm the Symfony Cache' unless system "app/console cache:clear -e #{environment}"
31
+ end
32
+
33
+ def self.install_assets
34
+ puts '---- Installing Assets'
35
+ fail 'Failed to install assets' unless system 'app/console assets:install'
36
+ end
37
+
38
+ end
39
+
40
+ require 'symfony/doctrine'
41
+ require 'symfony/fos-oauth'
@@ -0,0 +1,8 @@
1
+ class Behat
2
+
3
+ def self.run
4
+ puts 'Running all Behat tests'
5
+ fail 'Behat failed!' unless system 'bin/behat --verbose --no-interaction'
6
+ end
7
+
8
+ end
@@ -0,0 +1,8 @@
1
+ class Phpspec
2
+
3
+ def self.run
4
+ puts 'Running all Phpspecs'
5
+ fail 'Specs failed!' unless system 'bin/phpspec run -f pretty --no-interaction'
6
+ end
7
+
8
+ end
@@ -0,0 +1,14 @@
1
+ class Test
2
+
3
+ def self.behat
4
+ Behat
5
+ end
6
+
7
+ def self.phpspec
8
+ Phpspec
9
+ end
10
+
11
+ end
12
+
13
+ require 'test/behat'
14
+ require 'test/phpspec'
@@ -0,0 +1,13 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'rake-tools'
3
+ s.version = '0.1.0'
4
+ s.date = '2015-04-03'
5
+ s.summary = 'Preset tasks for Rake'
6
+ s.description = 'Preset tasks for Rake when building projects'
7
+ s.authors = ['VJ Patel']
8
+ s.email = 'meetthevj@gmail.com'
9
+ s.files = `git ls-files`.split("\n")
10
+ s.homepage =
11
+ 'http://rubygems.org/gems/rake-tools'
12
+ s.license = 'MIT'
13
+ end
metadata ADDED
@@ -0,0 +1,56 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rake-tools
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - VJ Patel
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-04-03 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Preset tasks for Rake when building projects
14
+ email: meetthevj@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - ".gitignore"
20
+ - LICENSE
21
+ - README.md
22
+ - lib/composer.rb
23
+ - lib/npm/npm.rb
24
+ - lib/rake-tools.rb
25
+ - lib/symfony/doctrine.rb
26
+ - lib/symfony/fos-oauth.rb
27
+ - lib/symfony/symfony.rb
28
+ - lib/test/behat.rb
29
+ - lib/test/phpspec.rb
30
+ - lib/test/test.rb
31
+ - rake-tools.gemspec
32
+ homepage: http://rubygems.org/gems/rake-tools
33
+ licenses:
34
+ - MIT
35
+ metadata: {}
36
+ post_install_message:
37
+ rdoc_options: []
38
+ require_paths:
39
+ - lib
40
+ required_ruby_version: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ required_rubygems_version: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ requirements: []
51
+ rubyforge_project:
52
+ rubygems_version: 2.4.6
53
+ signing_key:
54
+ specification_version: 4
55
+ summary: Preset tasks for Rake
56
+ test_files: []