laravel 0.5.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +0 -3
- data/README.md +29 -35
- data/Rakefile +2 -1
- data/bin/commands/config.rb +37 -12
- data/bin/commands/new.rb +6 -12
- data/bin/laravel +19 -9
- data/features/S_0__release.feature +13 -0
- data/features/S_3_new_customized.feature +26 -4
- data/features/S_4_config.feature +71 -5
- data/features/S_5_do.feature +14 -0
- data/features/step_definitions/app_steps.rb +72 -0
- data/features/step_definitions/config_steps.rb +29 -18
- data/features/step_definitions/new_steps.rb +54 -23
- data/features/support/env.rb +3 -1
- data/features/support/spec_helpers.rb +74 -0
- data/laravel.gemspec +4 -6
- data/lib/laravel.rb +0 -2
- data/lib/laravel/app.rb +58 -24
- data/lib/laravel/app_support.rb +46 -44
- data/lib/laravel/configuration.rb +230 -70
- data/lib/laravel/errors.rb +7 -35
- data/lib/laravel/helpers.rb +30 -25
- data/lib/laravel/version.rb +1 -1
- metadata +16 -21
- data/bin/commands/install.rb +0 -37
- data/features/S_5_install.feature +0 -13
- data/features/step_definitions/install_steps.rb +0 -9
- data/features/step_definitions/laravel.rb +0 -6
- data/features/step_definitions/requirements.rb +0 -20
- data/features/support/laravel_helpers.rb +0 -63
- data/lib/laravel/installer.rb +0 -61
- data/lib/laravel/settings.yml +0 -43
data/lib/laravel/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: laravel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
@@ -59,7 +59,7 @@ dependencies:
|
|
59
59
|
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
|
-
description:
|
62
|
+
description: Readily build new web applications using Laravel framework for PHP.
|
63
63
|
email:
|
64
64
|
- me@nikhgupta.com
|
65
65
|
executables:
|
@@ -74,21 +74,19 @@ files:
|
|
74
74
|
- README.md
|
75
75
|
- Rakefile
|
76
76
|
- bin/commands/config.rb
|
77
|
-
- bin/commands/install.rb
|
78
77
|
- bin/commands/new.rb
|
79
78
|
- bin/laravel
|
79
|
+
- features/S_0__release.feature
|
80
80
|
- features/S_1_new_online.feature
|
81
81
|
- features/S_2_new_offline.feature
|
82
82
|
- features/S_3_new_customized.feature
|
83
83
|
- features/S_4_config.feature
|
84
|
-
- features/
|
84
|
+
- features/S_5_do.feature
|
85
|
+
- features/step_definitions/app_steps.rb
|
85
86
|
- features/step_definitions/config_steps.rb
|
86
|
-
- features/step_definitions/install_steps.rb
|
87
|
-
- features/step_definitions/laravel.rb
|
88
87
|
- features/step_definitions/new_steps.rb
|
89
|
-
- features/step_definitions/requirements.rb
|
90
88
|
- features/support/env.rb
|
91
|
-
- features/support/
|
89
|
+
- features/support/spec_helpers.rb
|
92
90
|
- laravel.gemspec
|
93
91
|
- lib/laravel.rb
|
94
92
|
- lib/laravel/app.rb
|
@@ -96,8 +94,6 @@ files:
|
|
96
94
|
- lib/laravel/configuration.rb
|
97
95
|
- lib/laravel/errors.rb
|
98
96
|
- lib/laravel/helpers.rb
|
99
|
-
- lib/laravel/installer.rb
|
100
|
-
- lib/laravel/settings.yml
|
101
97
|
- lib/laravel/version.rb
|
102
98
|
homepage: https://github.com/nikhgupta/laravel
|
103
99
|
licenses: []
|
@@ -113,7 +109,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
113
109
|
version: '0'
|
114
110
|
segments:
|
115
111
|
- 0
|
116
|
-
hash:
|
112
|
+
hash: 3328694536106812419
|
117
113
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
114
|
none: false
|
119
115
|
requirements:
|
@@ -122,25 +118,24 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
118
|
version: '0'
|
123
119
|
segments:
|
124
120
|
- 0
|
125
|
-
hash:
|
121
|
+
hash: 3328694536106812419
|
126
122
|
requirements: []
|
127
123
|
rubyforge_project:
|
128
124
|
rubygems_version: 1.8.24
|
129
125
|
signing_key:
|
130
126
|
specification_version: 3
|
131
|
-
summary: This gem
|
132
|
-
|
133
|
-
|
127
|
+
summary: This gem helps in readily creating new web application based on the Laravel
|
128
|
+
framework for PHP with as much customization as possible. Moreover, it allows configuring
|
129
|
+
existing Laravel applications, and installing Laravel bundles for them.
|
134
130
|
test_files:
|
131
|
+
- features/S_0__release.feature
|
135
132
|
- features/S_1_new_online.feature
|
136
133
|
- features/S_2_new_offline.feature
|
137
134
|
- features/S_3_new_customized.feature
|
138
135
|
- features/S_4_config.feature
|
139
|
-
- features/
|
136
|
+
- features/S_5_do.feature
|
137
|
+
- features/step_definitions/app_steps.rb
|
140
138
|
- features/step_definitions/config_steps.rb
|
141
|
-
- features/step_definitions/install_steps.rb
|
142
|
-
- features/step_definitions/laravel.rb
|
143
139
|
- features/step_definitions/new_steps.rb
|
144
|
-
- features/step_definitions/requirements.rb
|
145
140
|
- features/support/env.rb
|
146
|
-
- features/support/
|
141
|
+
- features/support/spec_helpers.rb
|
data/bin/commands/install.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
module Laravel
|
2
|
-
# This module handles the subcommands used by this gem.
|
3
|
-
module Commands
|
4
|
-
# This class is responsible for the various installation tasks
|
5
|
-
# e.g. installing the bundles or other goodies.
|
6
|
-
class Install < Thor
|
7
|
-
class_option :debug, :type => :boolean
|
8
|
-
|
9
|
-
# This option specifies the application directory to use.
|
10
|
-
# By default, this is the path to the current directory.
|
11
|
-
class_option :app, :type => :string, :aliases => "-a",
|
12
|
-
:desc => "use the specified Laravel application instead of current directory"
|
13
|
-
|
14
|
-
# This option specifies whether we want to forcefully install
|
15
|
-
# the resource by overwriting already existing files.
|
16
|
-
# Virtually, this is the same as reinstalling a certain resource.
|
17
|
-
class_option :force, :type => :boolean,
|
18
|
-
:desc => "force an installation - same as reinstall"
|
19
|
-
|
20
|
-
# This task downloads the Laravel Generator by Jeffrey Way and creates
|
21
|
-
# a file called 'generate.php' in the tasks folder.
|
22
|
-
#
|
23
|
-
# Once done, we can use `php artisan generate` to get an overview of the
|
24
|
-
# different actions this laravel-task can perform.
|
25
|
-
#
|
26
|
-
desc "generator", "download the Laravel Generator by Jeffrey Way"
|
27
|
-
def generator
|
28
|
-
@installer = Laravel::Installer.new(options[:app])
|
29
|
-
begin
|
30
|
-
@installer.task_generator
|
31
|
-
rescue StandardError => e
|
32
|
-
Laravel::handle_error e, options[:debug]
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
Feature: Download Laravel Generator by Jeffrey Way
|
2
|
-
In order to generate code for my application quickly using :generate tasks
|
3
|
-
As a PHP developer acquinted with ruby
|
4
|
-
I want to use Laravel gem to download Laravel Generator by Jeffrey Way
|
5
|
-
|
6
|
-
Background: An application based on Laravel framework exists
|
7
|
-
Given I want to create a new application
|
8
|
-
When I create this application
|
9
|
-
Then the application should be ready for development
|
10
|
-
|
11
|
-
Scenario: download Laravel generator
|
12
|
-
When I install generator for this application
|
13
|
-
Then a task should be installed as "generate.php"
|
@@ -1,9 +0,0 @@
|
|
1
|
-
When /install generator for this application$/ do
|
2
|
-
step "I run `laravel install generator --app=#{@app_path}`"
|
3
|
-
end
|
4
|
-
|
5
|
-
Then /^(?:|a )tasks? should be installed as "(.*?)"$/ do |filename|
|
6
|
-
filepath = @app_tester.app.tasks_file(filename)
|
7
|
-
@app_tester.raise_error?(File.exists?(filepath))
|
8
|
-
step "the stdout should contain \"Installed task\""
|
9
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
Given /.*want to create (?:an|the|a new) application( forcefully)?$/ do |force|
|
2
|
-
@args = force ? "--force" : ""
|
3
|
-
end
|
4
|
-
|
5
|
-
Given /^I want to use( local cache for)? "(.*?)" as source$/ do |use_cache, source|
|
6
|
-
@source = source
|
7
|
-
@args = "#{@args} --source=#{source}"
|
8
|
-
end
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
Given /^I( do not)? want to update file permissions for storage$/ do |negate|
|
13
|
-
@args = "#{@args} #{negate ? "--no-perms" : "--perms"}"
|
14
|
-
end
|
15
|
-
Then /^file permissions on storage should( not)? be updated$/ do |negate|
|
16
|
-
step "the stdout should contain \"Updated permissions\"" unless negate
|
17
|
-
world_bit = sprintf("%o", File.stat(@app_path).mode).to_s[-1,1].to_i
|
18
|
-
is_world_writable = [2,3,6,7].include?(world_bit)
|
19
|
-
@app_tester.raise_error?(is_world_writable, negate)
|
20
|
-
end
|
@@ -1,63 +0,0 @@
|
|
1
|
-
module Laravel
|
2
|
-
# a means to test the gem
|
3
|
-
class AppTests
|
4
|
-
attr_reader :app, :app_path, :aruba
|
5
|
-
TestDirectory = File.expand_path(File.join(File.dirname(__FILE__), %w[ .. .. tmp aruba]))
|
6
|
-
|
7
|
-
# create a new object that handles the tests for us
|
8
|
-
#
|
9
|
-
# ==== Parameters
|
10
|
-
# +dir+ :: directory of the application - can be relative path or absolute path.
|
11
|
-
# +repo+ :: repository URL/directory for source
|
12
|
-
#
|
13
|
-
def initialize(dir = nil, repo = nil)
|
14
|
-
# Store absolute path to the directory
|
15
|
-
@app_path = dir || Dir.pwd
|
16
|
-
convert_to_relative_path
|
17
|
-
|
18
|
-
options = {
|
19
|
-
:force => false, :quiet => false,
|
20
|
-
:perms => true, :source => repo
|
21
|
-
}
|
22
|
-
|
23
|
-
# create a new Laravel App instance for given options
|
24
|
-
@app = Laravel::App.new(@app_path, options)
|
25
|
-
end
|
26
|
-
|
27
|
-
# get the relative path of a directory relative to the temporary path aruba creates
|
28
|
-
#
|
29
|
-
# ==== Parameters
|
30
|
-
# +relative_to+ :: Path to use as base directory, when converting to relative path.
|
31
|
-
# By default, it is the path to the aruba tmp directory
|
32
|
-
#
|
33
|
-
def convert_to_relative_path(relative_to = nil)
|
34
|
-
relative_to = TestDirectory unless relative_to
|
35
|
-
@app_path = File.expand_path(@app_path, relative_to)
|
36
|
-
end
|
37
|
-
|
38
|
-
# checks if the configuration file contains a particular string
|
39
|
-
#
|
40
|
-
# ==== Parameters
|
41
|
-
# +search+ :: the search term/regex pattern to look for
|
42
|
-
#
|
43
|
-
# ==== Return
|
44
|
-
# +boolean+:: true, if the search term was found in the configuration file.
|
45
|
-
#
|
46
|
-
def validate_configuration(search)
|
47
|
-
raise_error? File.readlines(@app.config_file).grep(Regexp.new search).any?
|
48
|
-
end
|
49
|
-
|
50
|
-
# raises an error based on a condition and negation
|
51
|
-
# if negation is not supplied, simply raises an error if condition is not true
|
52
|
-
#
|
53
|
-
# ==== Parameters
|
54
|
-
# +condition+ :: a condition to check against - if +negate+ is not provided,
|
55
|
-
# this condition raises an error if it evaluates to false.
|
56
|
-
# +negate+ :: negate the default behaviour
|
57
|
-
def raise_error?(condition, negate = nil)
|
58
|
-
raise ExpectationNotMetError if condition == !negate.nil?
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
World(Laravel)
|
data/lib/laravel/installer.rb
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
module Laravel
|
2
|
-
# This class handles the installation of certain tasks or some bundles, e.g.
|
3
|
-
# bob, sentry, etc. Since, these installation do not follow a definite
|
4
|
-
# pattern, we will need to define method that handles a particular
|
5
|
-
# installation.
|
6
|
-
class Installer < App
|
7
|
-
|
8
|
-
# This method acts as a gateway for the installation methods exposed by
|
9
|
-
# this class. The exposed methods follow a definite naming convention:
|
10
|
-
# {type}_{resource}, where {type} can either be 'task' or 'bundle', and
|
11
|
-
# {resource} is the name of the thing we are trying to install.
|
12
|
-
#
|
13
|
-
# For example: calling: task_generator() will install a task in the
|
14
|
-
# application/tasks/ folder, where 'do_task_generator' method defines how
|
15
|
-
# the particular install wil really be handled. Please, have a look at the
|
16
|
-
# source code of the above example for more information.
|
17
|
-
#
|
18
|
-
# The 'do_{method}' methods must be defined in this class, which actually
|
19
|
-
# handle the installation routine for us. These methods must have 'boolean'
|
20
|
-
# as their return value.
|
21
|
-
#
|
22
|
-
def method_missing(name, *args)
|
23
|
-
# know what we are doing
|
24
|
-
dissect = name.to_s.split "_"
|
25
|
-
type = dissect[0]
|
26
|
-
source = dissect[1]
|
27
|
-
|
28
|
-
# we MUST have a 'do_{method}' defined!!
|
29
|
-
if Installer.method_defined?("do_#{name}".to_sym)
|
30
|
-
|
31
|
-
if method("do_#{name}").call
|
32
|
-
say_success "Installed #{type}: #{source.capitalize}"
|
33
|
-
else
|
34
|
-
say_failed "Could not install #{type}: #{source.capitalize}"
|
35
|
-
end
|
36
|
-
else
|
37
|
-
say_failed "Don't know how to install #{source.capitalize}!"
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
# install the particular tasks or bundles by looking the options
|
42
|
-
# that the user has provided when running the 'new' task.
|
43
|
-
#
|
44
|
-
def from_options
|
45
|
-
return unless @options
|
46
|
-
|
47
|
-
# read and perform installs from options passed through the command line.
|
48
|
-
task_generator if @options[:generator]
|
49
|
-
end
|
50
|
-
|
51
|
-
# Install the Laravel Generator by Jeffrey Way. This creates a file named
|
52
|
-
# 'generate.php' in the application/tasks/ folder, which can be invoked as:
|
53
|
-
# `php artisan generate` using artisan.
|
54
|
-
#
|
55
|
-
def do_task_generator
|
56
|
-
url = "https://raw.github.com/JeffreyWay/Laravel-Generator/master/generate.php"
|
57
|
-
# download the Laravel Generator using curl as 'generate.php'
|
58
|
-
download_resource(tasks_file("generate.php"), url, "curl")
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
data/lib/laravel/settings.yml
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
config:
|
2
|
-
url:
|
3
|
-
factory: ""
|
4
|
-
default: __factory__
|
5
|
-
type: url
|
6
|
-
asset_url:
|
7
|
-
factory: ""
|
8
|
-
default: __factory__
|
9
|
-
type: url
|
10
|
-
index:
|
11
|
-
factory: index.php
|
12
|
-
default: ""
|
13
|
-
type: string
|
14
|
-
key:
|
15
|
-
factory: "YourSecretKeyGoesHere!"
|
16
|
-
default: __random__
|
17
|
-
type: string
|
18
|
-
profiler:
|
19
|
-
factory: false
|
20
|
-
default: __factory__
|
21
|
-
type: boolean
|
22
|
-
encoding:
|
23
|
-
factory: UTF-8
|
24
|
-
default: __factory__
|
25
|
-
type: string
|
26
|
-
language:
|
27
|
-
factory: en
|
28
|
-
default: __factory__
|
29
|
-
type: string
|
30
|
-
langauges:
|
31
|
-
supported: false
|
32
|
-
type: array
|
33
|
-
ssl:
|
34
|
-
factory: false
|
35
|
-
default: __factory__
|
36
|
-
type: boolean
|
37
|
-
timezone:
|
38
|
-
factory: UTC
|
39
|
-
default: __factory__
|
40
|
-
type: string
|
41
|
-
aliases:
|
42
|
-
supported: false
|
43
|
-
type: array
|