rails_tools 0.0.0
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/bin/rails_tools +29 -0
- metadata +68 -0
data/bin/rails_tools
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'tempfile'
|
3
|
+
|
4
|
+
class String #:nodoc: all
|
5
|
+
def margin
|
6
|
+
arr = self.split("\n")
|
7
|
+
arr.map!{|x| x.sub!(/\s*\|/,"")}
|
8
|
+
self.replace(arr.join("\n"))
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
begin
|
13
|
+
file = File.open('/tmp/rails_tools_fake_app.rb', 'w')
|
14
|
+
fake_app = <<-string_end.margin
|
15
|
+
|require 'rails/all'
|
16
|
+
|module FakeApp
|
17
|
+
| class Application < Rails::Application
|
18
|
+
| config.active_record.raise_in_transactional_callbacks = true
|
19
|
+
| end
|
20
|
+
|end
|
21
|
+
|
|
22
|
+
string_end
|
23
|
+
file.write fake_app
|
24
|
+
file.close
|
25
|
+
APP_PATH = file.path
|
26
|
+
require 'rails/commands'
|
27
|
+
ensure
|
28
|
+
File.delete(file.path)
|
29
|
+
end
|
metadata
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rails_tools
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Promix17
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2015-02-15 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rails
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
description: ! "## rails_tools ##\r\n\r\nRun Rails commands out of project to use
|
31
|
+
ActiveRecord and Migrations without Rails\r\n\r\n# Exampls #\r\n\r\nTo create model
|
32
|
+
and migration simply run this:\r\n\r\n > rails_tools g model user name -t=\r\n
|
33
|
+
\ < invoke active_record\r\n < create db/migrate/20150215100411_create_users.rb\r\n
|
34
|
+
\ < create app/models/user.rb\r\n < error [not found]\r\n\r\n# References
|
35
|
+
#\r\n\r\nhttp://blog.aizatto.com/2007/05/21/activerecord-without-rails/\r\nhttp://blog.aizatto.com/2007/05/27/activerecord-migrations-without-rails/\r\n"
|
36
|
+
email: promix17@yandex.ru
|
37
|
+
executables:
|
38
|
+
- rails_tools
|
39
|
+
extensions: []
|
40
|
+
extra_rdoc_files: []
|
41
|
+
files:
|
42
|
+
- bin/rails_tools
|
43
|
+
homepage: https://bitbucket.org/promix17/rails_tools
|
44
|
+
licenses: []
|
45
|
+
post_install_message:
|
46
|
+
rdoc_options: []
|
47
|
+
require_paths:
|
48
|
+
- lib
|
49
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
57
|
+
requirements:
|
58
|
+
- - ! '>='
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
requirements: []
|
62
|
+
rubyforge_project:
|
63
|
+
rubygems_version: 1.8.23
|
64
|
+
signing_key:
|
65
|
+
specification_version: 3
|
66
|
+
summary: Run Rails commands out of project to use ActiveRecord and Migrations without
|
67
|
+
Rails
|
68
|
+
test_files: []
|