mack-paths 0.6.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.
Files changed (3) hide show
  1. data/README +11 -0
  2. data/lib/mack-paths.rb +135 -0
  3. metadata +55 -0
data/README ADDED
@@ -0,0 +1,11 @@
1
+ Paths
2
+ ========================================================================
3
+
4
+ This simple gem gives applications some very simple methods to allow
5
+ developers to easily access the all the important directory paths for a
6
+ Mack application.
7
+
8
+ ===Examples:
9
+
10
+ Mack::Paths.views # => <MACK_PROJECT_ROOT>/app/views
11
+ Mack::Paths.plugins # => <MACK_PROJECT_ROOT>/vendor/plugins
data/lib/mack-paths.rb ADDED
@@ -0,0 +1,135 @@
1
+ module Mack
2
+ module Paths
3
+
4
+ # <MACK_PROJECT_ROOT>
5
+ def self.root(*files)
6
+ File.join(Mack.root, files)
7
+ end
8
+
9
+ # <MACK_PROJECT_ROOT>/public
10
+ def self.public(*files)
11
+ File.join(Mack.root, "public", files)
12
+ end
13
+
14
+ # <MACK_PROJECT_ROOT>/public/images
15
+ def self.images(*files)
16
+ File.join(Mack::Paths.public, "images", files)
17
+ end
18
+
19
+ # <MACK_PROJECT_ROOT>/public/javascripts
20
+ def self.javascripts(*files)
21
+ File.join(Mack::Paths.public, "javascripts", files)
22
+ end
23
+
24
+ # <MACK_PROJECT_ROOT>/public/stylesheets
25
+ def self.stylesheets(*files)
26
+ File.join(Mack::Paths.public, "stylesheets", files)
27
+ end
28
+
29
+ # <MACK_PROJECT_ROOT>/app
30
+ def self.app(*files)
31
+ File.join(Mack.root, "app", files)
32
+ end
33
+
34
+ # <MACK_PROJECT_ROOT>/log
35
+ def self.log(*files)
36
+ File.join(Mack.root, "log", files)
37
+ end
38
+
39
+ # <MACK_PROJECT_ROOT>/test
40
+ def self.test(*files)
41
+ File.join(Mack.root, "test", files)
42
+ end
43
+
44
+ # <MACK_PROJECT_ROOT>/test/functional
45
+ def self.functional(*files)
46
+ File.join(Mack::Paths.test, "functional", files)
47
+ end
48
+
49
+ # <MACK_PROJECT_ROOT>/test/unit
50
+ def self.unit(*files)
51
+ File.join(Mack::Paths.test, "unit", files)
52
+ end
53
+
54
+ # <MACK_PROJECT_ROOT>/app/views
55
+ def self.views(*files)
56
+ File.join(Mack::Paths.app, "views", files)
57
+ end
58
+
59
+ # <MACK_PROJECT_ROOT>/app/views/layouts
60
+ def self.layouts(*files)
61
+ File.join(Mack::Paths.views, "layouts", files)
62
+ end
63
+
64
+ # <MACK_PROJECT_ROOT>/app/controllers
65
+ def self.controllers(*files)
66
+ File.join(Mack::Paths.app, "controllers", files)
67
+ end
68
+
69
+ # <MACK_PROJECT_ROOT>/app/models
70
+ def self.models(*files)
71
+ File.join(Mack::Paths.app, "models", files)
72
+ end
73
+
74
+ # <MACK_PROJECT_ROOT>/app/helpers
75
+ def self.helpers(*files)
76
+ File.join(Mack::Paths.app, "helpers", files)
77
+ end
78
+
79
+ # <MACK_PROJECT_ROOT>/app/helpers/controllers
80
+ def self.controller_helpers(*files)
81
+ File.join(Mack::Paths.helpers, "controllers", files)
82
+ end
83
+
84
+ # <MACK_PROJECT_ROOT>/app/helpers/controllers
85
+ def self.view_helpers(*files)
86
+ File.join(Mack::Paths.helpers, "views", files)
87
+ end
88
+
89
+ # <MACK_PROJECT_ROOT>/lib
90
+ def self.lib(*files)
91
+ File.join(Mack.root, "lib", files)
92
+ end
93
+
94
+ # <MACK_PROJECT_ROOT>/lib/tasks
95
+ def self.tasks(*files)
96
+ File.join(Mack::Paths.lib, "tasks", files)
97
+ end
98
+
99
+ # <MACK_PROJECT_ROOT>/db
100
+ def self.db(*files)
101
+ File.join(Mack.root, "db", files)
102
+ end
103
+
104
+ # <MACK_PROJECT_ROOT>/db/migrations
105
+ def self.migrations(*files)
106
+ File.join(Mack::Paths.db, "migrations", files)
107
+ end
108
+
109
+ # <MACK_PROJECT_ROOT>/config
110
+ def self.config(*files)
111
+ File.join(Mack.root, "config", files)
112
+ end
113
+
114
+ # <MACK_PROJECT_ROOT>/config/app_config
115
+ def self.app_config(*files)
116
+ File.join(Mack::Paths.config, "app_config", files)
117
+ end
118
+
119
+ # <MACK_PROJECT_ROOT>/config/initializers
120
+ def self.initializers(*files)
121
+ File.join(Mack::Paths.config, "initializers", files)
122
+ end
123
+
124
+ # <MACK_PROJECT_ROOT>/vendor
125
+ def self.vendor(*files)
126
+ File.join(Mack.root, "vendor", files)
127
+ end
128
+
129
+ # <MACK_PROJECT_ROOT>/vendor/plugins
130
+ def self.plugins(*files)
131
+ File.join(Mack::Paths.vendor, "plugins", files)
132
+ end
133
+
134
+ end # Paths
135
+ end # Mack
metadata ADDED
@@ -0,0 +1,55 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mack-paths
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.6.0
5
+ platform: ruby
6
+ authors:
7
+ - Mark Bates
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-07-16 00:00:00 -04:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: Common paths for Mack applications.
17
+ email: mark@mackframework.com
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files: []
23
+
24
+ files:
25
+ - lib/mack-paths.rb
26
+ - README
27
+ has_rdoc: true
28
+ homepage: http://www.mackframework.com
29
+ post_install_message:
30
+ rdoc_options: []
31
+
32
+ require_paths:
33
+ - lib
34
+ - lib
35
+ required_ruby_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: "0"
40
+ version:
41
+ required_rubygems_version: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: "0"
46
+ version:
47
+ requirements: []
48
+
49
+ rubyforge_project: magrathea
50
+ rubygems_version: 1.1.1
51
+ signing_key:
52
+ specification_version: 2
53
+ summary: Common paths for Mack applications.
54
+ test_files: []
55
+