mariusz-dm-is-formattable 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/Rakefile +64 -0
  2. data/spec/spec.opts +1 -0
  3. data/spec/spec_helper.rb +140 -0
  4. metadata +85 -0
@@ -0,0 +1,64 @@
1
+ require 'rake'
2
+ require 'rake/rdoctask'
3
+ require 'rake/testtask'
4
+ require 'spec/rake/spectask'
5
+ require 'fileutils'
6
+ require 'merb-core'
7
+ require 'rubigen'
8
+ require 'merb-core/tasks/merb'
9
+ require 'merb-core/test/tasks/spectasks'
10
+ include FileUtils
11
+
12
+ #begin
13
+ # require 'vlad'
14
+ # Vlad.load :scm => "git"
15
+ #rescue LoadError
16
+ # # do nothing
17
+ #end
18
+
19
+ # Load the basic runtime dependencies; this will include
20
+ # any plugins and therefore plugin rake tasks.
21
+ init_env = ENV['MERB_ENV'] || 'rake'
22
+ Merb.load_dependencies(:environment => init_env)
23
+
24
+ # Get Merb plugins and dependencies
25
+ Merb::Plugins.rakefiles.each { |r| require r }
26
+
27
+ # Load any app level custom rakefile extensions from lib/tasks
28
+ tasks_path = File.join(File.dirname(__FILE__), "lib", "tasks")
29
+ rake_files = Dir["#{tasks_path}/*.rb"]
30
+ rake_files.each{|rake_file| load rake_file }
31
+
32
+
33
+ desc "start runner environment"
34
+ task :merb_env do
35
+ Merb.start_environment(:environment => init_env, :adapter => 'runner')
36
+ end
37
+
38
+ ##############################################################################
39
+ # ADD YOUR CUSTOM TASKS IN /lib/tasks
40
+ # NAME YOUR RAKE FILES file_name.rake
41
+ ##############################################################################
42
+
43
+ namespace :utype do
44
+
45
+ desc 'install utype'
46
+ task :install => :merb_env do
47
+ puts 'Installing utype...'
48
+ Utype::App.install
49
+ end
50
+
51
+ namespace :components do
52
+ desc 'install a component'
53
+ task :install => :merb_env do
54
+ name = ENV['NAME']
55
+ if name.blank?
56
+ puts 'Please run with a component name, like: rake utype:components:install NAME=your_component'
57
+ return
58
+ end
59
+ puts %( Installing component "#{name}"... )
60
+ ComponentInstallation.install(name)
61
+ end
62
+ end
63
+
64
+ end
@@ -0,0 +1 @@
1
+ --color
@@ -0,0 +1,140 @@
1
+ require 'rubygems'
2
+
3
+ # Add the local gems dir if found within the app root; any dependencies loaded
4
+ # hereafter will try to load from the local gems before loading system gems.
5
+ if (local_gem_dir = File.join(File.dirname(__FILE__), '..', 'gems')) && $BUNDLE.nil?
6
+ $BUNDLE = true; Gem.clear_paths; Gem.path.unshift(local_gem_dir)
7
+ end
8
+
9
+ require 'merb-core'
10
+ require 'spec' # Satisfies Autotest and anyone else not using the Rake tasks
11
+
12
+ Merb.start_environment(:testing => true, :adapter => 'runner', :environment => ENV['MERB_ENV'] || 'test')
13
+
14
+ Spec::Runner.configure do |config|
15
+ config.include(Merb::Test::ViewHelper)
16
+ config.include(Merb::Test::RouteHelper)
17
+ config.include(Merb::Test::ControllerHelper)
18
+ end
19
+
20
+ DataMapper.auto_migrate!
21
+ Role.install_base_roles
22
+ PageType.install_core_page_types
23
+
24
+ @@users = {
25
+ :admin => User.create(
26
+ :login => 'admin',
27
+ :password => 'admin123',
28
+ :password_confirmation => 'admin123',
29
+ :email => 'admin@utype.com',
30
+ :role_id => Role.roles[:admin],
31
+ :admin_theme => 'test'
32
+ ),
33
+ :author => User.create(
34
+ :login => 'jane',
35
+ :password => 'abcd123',
36
+ :password_confirmation => 'abcd123',
37
+ :email => 'jane.doe@utype.com',
38
+ :role_id => Role.roles[:author]
39
+ ),
40
+ :editor => User.create(
41
+ :login => 'john',
42
+ :password => 'abcd123',
43
+ :password_confirmation => 'abcd123',
44
+ :email => 'john.doe@utype.com',
45
+ :role_id => Role.roles[:editor]
46
+ ),
47
+ :subscriber => User.create(
48
+ :login => 'jan',
49
+ :password => 'abcd123',
50
+ :password_confirmation => 'abcd123',
51
+ :email => 'jan.kowalski@utype.com',
52
+ :role_id => Role.roles[:subscriber]
53
+ )
54
+ }
55
+
56
+ Admin::Site.current = Admin::Site.new(@@users[:admin])
57
+ Admin::Site.install_core_pages
58
+ Admin::Site.install_core_components
59
+
60
+ Site.create(
61
+ :name => 'UType',
62
+ :url => 'www.utype.org',
63
+ :theme_name => 'test',
64
+ :user_id => 1,
65
+ :is_default => true
66
+ )
67
+ Site.create(
68
+ :name => 'Home',
69
+ :url => 'www.home.org',
70
+ :user_id => 1
71
+ )
72
+
73
+ Category.create(
74
+ :site_id => 1,
75
+ :name => 'News',
76
+ :is_default => true
77
+ )
78
+ Category.create(
79
+ :site_id => 1,
80
+ :name => 'Documentation'
81
+ )
82
+
83
+ ComponentInstallation.create(
84
+ :name => 'Headlines',
85
+ :part => 'Headlines',
86
+ :template_token => 'headlines'
87
+ )
88
+ ComponentInstallation.create(
89
+ :name => 'Blog',
90
+ :part => 'Blog'
91
+ )
92
+ ComponentInstallation.create(
93
+ :name => 'Funky Stuf',
94
+ :part => 'Funky'
95
+ )
96
+
97
+ PageType.create(
98
+ :component_installation_id => ComponentInstallation.first(:part => 'Headlines').id,
99
+ :name => 'Headlines',
100
+ :description => 'Displays a list of headlines of your latest articles'
101
+ )
102
+ PageType.create(
103
+ :component_installation_id => ComponentInstallation.first(:part => 'Funky').id,
104
+ :name => 'Funky',
105
+ :description => 'Displays a list of funky things'
106
+ )
107
+ Page.create(
108
+ :name => 'A Page',
109
+ :site_id => 1,
110
+ :is_default => true,
111
+ :template => 'a_section'
112
+ )
113
+ Page.create(
114
+ :name => 'Fresh stuff',
115
+ :site_id => 1,
116
+ :page_type_id => PageType.first(:name => 'Headlines').id
117
+ )
118
+ Page.create(
119
+ :name => 'About Me',
120
+ :site_id => 1,
121
+ :template => 'about_me',
122
+ :template_layout => 'about_me'
123
+ )
124
+ Page.create(
125
+ :name => 'My Posts',
126
+ :site_id => 1,
127
+ :template => 'my_articles'
128
+ )
129
+ Admin::PageAction.create(
130
+ :title => 'Users Stats',
131
+ :permalink => 'admin/users/stats',
132
+ :page_id => 0
133
+ )
134
+ Content.create(
135
+ :title => 'A title',
136
+ :body => 'A body',
137
+ :user_id => 2,
138
+ :site_id => 1,
139
+ :page_id => 1
140
+ )
metadata ADDED
@@ -0,0 +1,85 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mariusz-dm-is-formattable
3
+ version: !ruby/object:Gem::Version
4
+ version: "0.1"
5
+ platform: ruby
6
+ authors:
7
+ - Piotr Solnica
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-11-08 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: dm-core
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - "="
21
+ - !ruby/object:Gem::Version
22
+ version: 0.9.7
23
+ version:
24
+ - !ruby/object:Gem::Dependency
25
+ name: hoe
26
+ version_requirement:
27
+ version_requirements: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: 1.8.2
32
+ version:
33
+ description: Formatting engines support for DataMapper
34
+ email:
35
+ - piotr [a] zenbe [d] com
36
+ executables: []
37
+
38
+ extensions: []
39
+
40
+ extra_rdoc_files:
41
+ - README.txt
42
+ - LICENSE
43
+ - TODO
44
+ files:
45
+ - History.txt
46
+ - LICENSE
47
+ - Manifest.txt
48
+ - README.txt
49
+ - Rakefile
50
+ - TODO
51
+ - lib/dm-is-formattable.rb
52
+ - lib/dm-is-formattable/is/formattable.rb
53
+ - lib/dm-is-formattable/is/version.rb
54
+ - spec/integration/formattable_spec.rb
55
+ - spec/spec.opts
56
+ - spec/spec_helper.rb
57
+ has_rdoc: true
58
+ homepage: http://github.com/sam/dm-more/tree/master/dm-is-formattable
59
+ post_install_message:
60
+ rdoc_options:
61
+ - --main
62
+ - README.txt
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: "0"
70
+ version:
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: "0"
76
+ version:
77
+ requirements: []
78
+
79
+ rubyforge_project: datamapper
80
+ rubygems_version: 1.2.0
81
+ signing_key:
82
+ specification_version: 2
83
+ summary: Formatting engines support for DataMapper
84
+ test_files: []
85
+