fat_free_crm 0.20.1 → 0.21.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fat_free_crm might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +170 -0
- data/README.md +3 -6
- data/app/assets/config/manifest.js +3 -0
- data/app/helpers/accounts_helper.rb +2 -0
- data/app/helpers/application_helper.rb +22 -3
- data/app/helpers/tasks_helper.rb +1 -2
- data/app/models/entities/account.rb +1 -1
- data/app/models/entities/campaign.rb +1 -1
- data/app/models/entities/contact.rb +1 -1
- data/app/models/entities/lead.rb +1 -1
- data/app/models/entities/opportunity.rb +1 -1
- data/app/models/polymorphic/avatar.rb +1 -30
- data/app/models/polymorphic/task.rb +1 -0
- data/app/views/home/index.xls.builder +1 -0
- data/app/views/shared/_address.html.haml +1 -1
- data/config/application.rb +13 -0
- data/config/environments/development.rb +3 -0
- data/config/puma.rb +2 -2
- data/config/storage.yml +34 -0
- data/db/migrate/20100928030617_drop_openid_tables.rb +2 -1
- data/db/migrate/20230526211831_create_active_storage_tables.active_storage.rb +51 -0
- data/db/migrate/20230526212613_convert_to_active_storage.rb +91 -0
- data/db/schema.rb +65 -35
- data/db/seeds/fields.rb +7 -21
- data/lib/development_tasks/license.rake +10 -10
- data/lib/fat_free_crm/errors.rb +2 -10
- data/lib/fat_free_crm/exceptions.rb +1 -0
- data/lib/fat_free_crm/fields.rb +4 -5
- data/lib/fat_free_crm/gem_dependencies.rb +0 -1
- data/lib/fat_free_crm/i18n.rb +1 -1
- data/lib/fat_free_crm/version.rb +3 -3
- metadata +16 -279
- data/.docker/nginx/sites-enabled/ffcrm.conf +0 -8
- data/.github/workflows/brakeman-analysis.yml +0 -46
- data/.github/workflows/rubocop-analysis.yml +0 -40
- data/.github/workflows/ruby.yml +0 -52
- data/.gitignore +0 -39
- data/.rubocop.yml +0 -73
- data/.rubocop_todo.yml +0 -286
- data/.teatro.yml +0 -3
- data/.travis.yml +0 -60
- data/CONTRIBUTORS.md +0 -135
- data/Capfile +0 -27
- data/Dockerfile +0 -51
- data/Gemfile +0 -106
- data/Gemfile.lock +0 -529
- data/Guardfile +0 -26
- data/Procfile +0 -1
- data/SECURITY.md +0 -11
- data/Vagrantfile +0 -92
- data/custom_plan.rb +0 -11
- data/docker-compose.yml +0 -27
- data/fat_free_crm.gemspec +0 -62
- data/lib/tasks/.gitkeep +0 -0
- data/lib/tasks/.gitkeep~master +0 -0
- data/script/rails +0 -8
- data/spec/controllers/admin/groups_controller_spec.rb +0 -11
- data/spec/controllers/admin/users_controller_spec.rb +0 -251
- data/spec/controllers/applications_controller_spec.rb +0 -43
- data/spec/controllers/comments_controller_spec.rb +0 -195
- data/spec/controllers/emails_controller_spec.rb +0 -37
- data/spec/controllers/entities/accounts_controller_spec.rb +0 -607
- data/spec/controllers/entities/campaigns_controller_spec.rb +0 -645
- data/spec/controllers/entities/contacts_controller_spec.rb +0 -705
- data/spec/controllers/entities/leads_controller_spec.rb +0 -1009
- data/spec/controllers/entities/opportunities_controller_spec.rb +0 -904
- data/spec/controllers/entities_controller_spec.rb +0 -47
- data/spec/controllers/home_controller_spec.rb +0 -235
- data/spec/controllers/lists_controller_spec.rb +0 -11
- data/spec/controllers/tasks_controller_spec.rb +0 -517
- data/spec/controllers/users_controller_spec.rb +0 -375
- data/spec/factories/account_factories.rb +0 -40
- data/spec/factories/campaign_factories.rb +0 -30
- data/spec/factories/contact_factories.rb +0 -45
- data/spec/factories/field_factories.rb +0 -40
- data/spec/factories/lead_factories.rb +0 -36
- data/spec/factories/list_factories.rb +0 -13
- data/spec/factories/opportunity_factories.rb +0 -39
- data/spec/factories/sequences.rb +0 -32
- data/spec/factories/setting_factories.rb +0 -15
- data/spec/factories/shared_factories.rb +0 -70
- data/spec/factories/subscription_factories.rb +0 -13
- data/spec/factories/tag_factories.rb +0 -12
- data/spec/factories/task_factories.rb +0 -29
- data/spec/factories/user_factories.rb +0 -66
- data/spec/features/acceptance_helper.rb +0 -11
- data/spec/features/accounts_spec.rb +0 -126
- data/spec/features/admin/groups_spec.rb +0 -31
- data/spec/features/admin/users_spec.rb +0 -40
- data/spec/features/campaigns_spec.rb +0 -104
- data/spec/features/contacts_spec.rb +0 -134
- data/spec/features/dashboard_spec.rb +0 -67
- data/spec/features/devise/sign_in_spec.rb +0 -58
- data/spec/features/devise/sign_up_spec.rb +0 -36
- data/spec/features/leads_spec.rb +0 -138
- data/spec/features/opportunities_overview_spec.rb +0 -88
- data/spec/features/opportunities_spec.rb +0 -132
- data/spec/features/support/autocomlete_helper.rb +0 -17
- data/spec/features/support/browser.rb +0 -28
- data/spec/features/support/headless.rb +0 -19
- data/spec/features/support/paths.rb +0 -48
- data/spec/features/support/selector_helpers.rb +0 -36
- data/spec/features/tasks_spec.rb +0 -94
- data/spec/fixtures/rails.png +0 -0
- data/spec/helpers/accounts_helper_spec.rb +0 -73
- data/spec/helpers/admin/field_groups_helper_spec.rb +0 -20
- data/spec/helpers/admin/plugins_helper_spec.rb +0 -11
- data/spec/helpers/admin/settings_helper_spec.rb +0 -11
- data/spec/helpers/admin/users_helper_spec.rb +0 -11
- data/spec/helpers/application_helper_spec.rb +0 -86
- data/spec/helpers/authentications_helper_spec.rb +0 -16
- data/spec/helpers/campaigns_helper_spec.rb +0 -16
- data/spec/helpers/comments_helper_spec.rb +0 -16
- data/spec/helpers/contacts_helper_spec.rb +0 -16
- data/spec/helpers/emails_helper_spec.rb +0 -11
- data/spec/helpers/fields_helper_spec.rb +0 -12
- data/spec/helpers/groups_helper_spec.rb +0 -21
- data/spec/helpers/home_helper_spec.rb +0 -16
- data/spec/helpers/leads_helper_spec.rb +0 -16
- data/spec/helpers/lists_helper_spec.rb +0 -21
- data/spec/helpers/opportunities_helper_spec.rb +0 -16
- data/spec/helpers/passwords_helper_spec.rb +0 -16
- data/spec/helpers/tasks_helper_spec.rb +0 -20
- data/spec/helpers/users_helper_spec.rb +0 -39
- data/spec/lib/comment_extensions_spec.rb +0 -42
- data/spec/lib/core_ext/string_spec.rb +0 -23
- data/spec/lib/errors_spec.rb +0 -32
- data/spec/lib/fields_spec.rb +0 -101
- data/spec/lib/mail_processor/base_spec.rb +0 -169
- data/spec/lib/mail_processor/comment_replies_spec.rb +0 -70
- data/spec/lib/mail_processor/dropbox_spec.rb +0 -306
- data/spec/lib/mail_processor/sample_emails/dropbox.rb +0 -173
- data/spec/lib/permissions_spec.rb +0 -155
- data/spec/lib/secret_token_generator_spec.rb +0 -69
- data/spec/lib/view_factory_spec.rb +0 -69
- data/spec/mailers/devise_mailer_spec.rb +0 -35
- data/spec/mailers/subscription_mailer_spec.rb +0 -48
- data/spec/mailers/user_mailer_spec.rb +0 -115
- data/spec/models/entities/account_contact_spec.rb +0 -34
- data/spec/models/entities/account_opportunity_spec.rb +0 -34
- data/spec/models/entities/account_spec.rb +0 -206
- data/spec/models/entities/campaign_spec.rb +0 -131
- data/spec/models/entities/contact_opportunity_spec.rb +0 -34
- data/spec/models/entities/contact_spec.rb +0 -314
- data/spec/models/entities/lead_spec.rb +0 -102
- data/spec/models/entities/opportunity_spec.rb +0 -299
- data/spec/models/fields/custom_field_date_pair_spec.rb +0 -92
- data/spec/models/fields/custom_field_pair_spec.rb +0 -76
- data/spec/models/fields/custom_field_spec.rb +0 -129
- data/spec/models/fields/field_group_spec.rb +0 -29
- data/spec/models/fields/field_spec.rb +0 -69
- data/spec/models/list_spec.rb +0 -19
- data/spec/models/observers/entity_observer_spec.rb +0 -74
- data/spec/models/polymorphic/address_spec.rb +0 -34
- data/spec/models/polymorphic/avatar_spec.rb +0 -46
- data/spec/models/polymorphic/comment_spec.rb +0 -45
- data/spec/models/polymorphic/email_spec.rb +0 -53
- data/spec/models/polymorphic/task_spec.rb +0 -395
- data/spec/models/polymorphic/version_spec.rb +0 -241
- data/spec/models/setting_spec.rb +0 -77
- data/spec/models/users/abilities/user_ability_spec.rb +0 -70
- data/spec/models/users/group_spec.rb +0 -11
- data/spec/models/users/permission_spec.rb +0 -58
- data/spec/models/users/preference_spec.rb +0 -71
- data/spec/models/users/user_spec.rb +0 -238
- data/spec/routing/accounts_routing_spec.rb +0 -60
- data/spec/routing/admin/users_routing_spec.rb +0 -40
- data/spec/routing/campaigns_routing_spec.rb +0 -64
- data/spec/routing/comments_routing_spec.rb +0 -32
- data/spec/routing/contacts_routing_spec.rb +0 -60
- data/spec/routing/emails_routing_spec.rb +0 -40
- data/spec/routing/leads_routing_spec.rb +0 -88
- data/spec/routing/opportunities_routing_spec.rb +0 -64
- data/spec/routing/tasks_routing_spec.rb +0 -68
- data/spec/routing/users_routing_spec.rb +0 -106
- data/spec/shared/controllers.rb +0 -99
- data/spec/shared/models.rb +0 -141
- data/spec/spec_helper.rb +0 -117
- data/spec/support/assert_select.rb +0 -167
- data/spec/support/devise_helpers.rb +0 -28
- data/spec/support/feature_helpers.rb +0 -32
- data/spec/support/macros.rb +0 -49
- data/spec/support/mail_processor_mocks.rb +0 -37
- data/spec/support/uploaded_file.rb +0 -10
- data/spec/views/accounts/_edit.haml_spec.rb +0 -43
- data/spec/views/accounts/_new.haml_spec.rb +0 -42
- data/spec/views/accounts/create.js.haml_spec.rb +0 -52
- data/spec/views/accounts/destroy.js.haml_spec.rb +0 -34
- data/spec/views/accounts/edit.js.haml_spec.rb +0 -66
- data/spec/views/accounts/index.haml_spec.rb +0 -43
- data/spec/views/accounts/index.js.haml_spec.rb +0 -34
- data/spec/views/accounts/new.js.haml_spec.rb +0 -44
- data/spec/views/accounts/show.haml_spec.rb +0 -38
- data/spec/views/accounts/update.js.haml_spec.rb +0 -93
- data/spec/views/admin/field_groups/create.js.haml_spec.rb +0 -30
- data/spec/views/admin/field_groups/destroy.js.haml_spec.rb +0 -31
- data/spec/views/admin/field_groups/edit.js.haml_spec.rb +0 -24
- data/spec/views/admin/field_groups/new.js.haml_spec.rb +0 -25
- data/spec/views/admin/field_groups/update.js.haml_spec.rb +0 -29
- data/spec/views/admin/users/_create.haml_spec.rb +0 -23
- data/spec/views/admin/users/create.js.haml_spec.rb +0 -41
- data/spec/views/admin/users/destroy.js.haml_spec.rb +0 -47
- data/spec/views/admin/users/edit.js.haml_spec.rb +0 -44
- data/spec/views/admin/users/index.haml_spec.rb +0 -22
- data/spec/views/admin/users/index.js.haml_spec.rb +0 -26
- data/spec/views/admin/users/new.js.haml_spec.rb +0 -34
- data/spec/views/admin/users/reactivate.js.haml_spec.rb +0 -22
- data/spec/views/admin/users/show.haml_spec.rb +0 -18
- data/spec/views/admin/users/suspend.js.haml_spec.rb +0 -22
- data/spec/views/admin/users/update.js.haml_spec.rb +0 -37
- data/spec/views/application/auto_complete.haml_spec.rb +0 -48
- data/spec/views/campaigns/_edit.haml_spec.rb +0 -44
- data/spec/views/campaigns/_new.haml_spec.rb +0 -41
- data/spec/views/campaigns/create.js.haml_spec.rb +0 -49
- data/spec/views/campaigns/destroy.js.haml_spec.rb +0 -31
- data/spec/views/campaigns/edit.js.haml_spec.rb +0 -66
- data/spec/views/campaigns/index.haml_spec.rb +0 -37
- data/spec/views/campaigns/index.js.haml_spec.rb +0 -34
- data/spec/views/campaigns/new.js.haml_spec.rb +0 -50
- data/spec/views/campaigns/show.haml_spec.rb +0 -38
- data/spec/views/campaigns/update.js.haml_spec.rb +0 -78
- data/spec/views/comments/edit.js.haml_spec.rb +0 -30
- data/spec/views/contacts/_edit.haml_spec.rb +0 -73
- data/spec/views/contacts/_new.haml_spec.rb +0 -52
- data/spec/views/contacts/create.js.haml_spec.rb +0 -65
- data/spec/views/contacts/destroy.js.haml_spec.rb +0 -45
- data/spec/views/contacts/edit.js.haml_spec.rb +0 -74
- data/spec/views/contacts/index.haml_spec.rb +0 -37
- data/spec/views/contacts/index.js.html_spec.rb +0 -34
- data/spec/views/contacts/new.js.haml_spec.rb +0 -47
- data/spec/views/contacts/show.haml_spec.rb +0 -35
- data/spec/views/contacts/update.js.haml_spec.rb +0 -128
- data/spec/views/home/index.haml_spec.rb +0 -36
- data/spec/views/home/index.js.haml_spec.rb +0 -33
- data/spec/views/home/options.js.haml_spec.rb +0 -53
- data/spec/views/leads/_convert.haml_spec.rb +0 -30
- data/spec/views/leads/_edit.haml_spec.rb +0 -47
- data/spec/views/leads/_new.haml_spec.rb +0 -45
- data/spec/views/leads/_sidebar_show.haml_spec.rb +0 -31
- data/spec/views/leads/convert.js.haml_spec.rb +0 -79
- data/spec/views/leads/create.js.haml_spec.rb +0 -67
- data/spec/views/leads/destroy.js.haml_spec.rb +0 -47
- data/spec/views/leads/edit.js.haml_spec.rb +0 -76
- data/spec/views/leads/index.haml_spec.rb +0 -37
- data/spec/views/leads/index.js.haml_spec.rb +0 -34
- data/spec/views/leads/new.js.haml_spec.rb +0 -47
- data/spec/views/leads/promote.js.haml_spec.rb +0 -135
- data/spec/views/leads/reject.js.haml_spec.rb +0 -45
- data/spec/views/leads/show.haml_spec.rb +0 -32
- data/spec/views/leads/update.js.haml_spec.rb +0 -118
- data/spec/views/opportunities/_edit.haml_spec.rb +0 -70
- data/spec/views/opportunities/_new.haml_spec.rb +0 -51
- data/spec/views/opportunities/create.js.haml_spec.rb +0 -86
- data/spec/views/opportunities/destroy.js.haml_spec.rb +0 -64
- data/spec/views/opportunities/edit.js.haml_spec.rb +0 -75
- data/spec/views/opportunities/index.haml_spec.rb +0 -38
- data/spec/views/opportunities/index.js.haml_spec.rb +0 -35
- data/spec/views/opportunities/new.js.haml_spec.rb +0 -54
- data/spec/views/opportunities/show.haml_spec.rb +0 -35
- data/spec/views/opportunities/update.js.haml_spec.rb +0 -143
- data/spec/views/tasks/_edit.haml_spec.rb +0 -50
- data/spec/views/tasks/complete.js.haml_spec.rb +0 -67
- data/spec/views/tasks/create.js.haml_spec.rb +0 -119
- data/spec/views/tasks/destroy.js.haml_spec.rb +0 -57
- data/spec/views/tasks/edit.js.haml_spec.rb +0 -76
- data/spec/views/tasks/index.haml_spec.rb +0 -46
- data/spec/views/tasks/new.js.haml_spec.rb +0 -49
- data/spec/views/tasks/uncomplete.js.haml_spec.rb +0 -45
- data/spec/views/tasks/update.js.haml_spec.rb +0 -140
- data/spec/views/users/avatar.js.haml_spec.rb +0 -35
- data/spec/views/users/change_password.js.haml_spec.rb +0 -51
- data/spec/views/users/edit.js.haml_spec.rb +0 -35
- data/spec/views/users/password.js.haml_spec.rb +0 -36
- data/spec/views/users/update.js.haml_spec.rb +0 -46
- data/spec/views/users/upload_avatar.js.haml_spec.rb +0 -45
- data/vendor/gems/globby-0.1.2/LICENSE.txt +0 -20
- data/vendor/gems/globby-0.1.2/README.md +0 -65
- data/vendor/gems/globby-0.1.2/Rakefile +0 -9
- data/vendor/gems/globby-0.1.2/lib/globby/glob.rb +0 -90
- data/vendor/gems/globby-0.1.2/lib/globby/globject.rb +0 -18
- data/vendor/gems/globby-0.1.2/lib/globby/result.rb +0 -20
- data/vendor/gems/globby-0.1.2/lib/globby.rb +0 -47
- data/vendor/gems/globby-0.1.2/spec/gitignore_spec.rb +0 -109
- data/vendor/gems/globby-0.1.2/spec/globby_spec.rb +0 -93
- data/zeus.json +0 -22
@@ -1,109 +0,0 @@
|
|
1
|
-
require 'globby'
|
2
|
-
require 'tmpdir'
|
3
|
-
require 'fileutils'
|
4
|
-
|
5
|
-
describe Globby do
|
6
|
-
around do |example|
|
7
|
-
gitignore_test { example.run }
|
8
|
-
end
|
9
|
-
|
10
|
-
describe ".select" do
|
11
|
-
it "should match .gitignore perfectly" do
|
12
|
-
rules = prepare_gitignore
|
13
|
-
expect(Globby.select(rules.split(/\n/))).to eq(all_files - git_files - untracked)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe ".reject" do
|
18
|
-
it "should match the inverse of .gitignore, plus .git" do
|
19
|
-
rules = prepare_gitignore
|
20
|
-
expect(Globby.reject(rules.split(/\n/))).to eq(git_files + untracked)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
def gitignore_test
|
25
|
-
Dir.mktmpdir do |dir|
|
26
|
-
Dir.chdir(dir) do
|
27
|
-
prepare_files
|
28
|
-
`git init .`
|
29
|
-
yield
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
def prepare_gitignore
|
35
|
-
ignore = <<-IGNORE.gsub(/^ +/, '')
|
36
|
-
# here we go...
|
37
|
-
|
38
|
-
# some dotfiles
|
39
|
-
.hidden
|
40
|
-
|
41
|
-
# html, but just in the root
|
42
|
-
/*.html
|
43
|
-
|
44
|
-
# all rb files anywhere
|
45
|
-
*.rb
|
46
|
-
|
47
|
-
# except rb files immediately under foobar
|
48
|
-
!foobar/*.rb
|
49
|
-
|
50
|
-
# ooh look **
|
51
|
-
/a/**/*.yuss
|
52
|
-
|
53
|
-
# this will match foo/bar but not bar
|
54
|
-
bar/
|
55
|
-
|
56
|
-
# this will match nothing
|
57
|
-
foo*bar/baz.pdf
|
58
|
-
|
59
|
-
# this will match baz/ and foobar/baz/
|
60
|
-
baz
|
61
|
-
|
62
|
-
# check reinclusion
|
63
|
-
/spec/*
|
64
|
-
!/spec/noignore
|
65
|
-
IGNORE
|
66
|
-
File.open('.gitignore', 'w'){ |f| f.write ignore }
|
67
|
-
ignore
|
68
|
-
end
|
69
|
-
|
70
|
-
def prepare_files
|
71
|
-
files = <<-FILES.strip.split(/\s+/)
|
72
|
-
.gitignore
|
73
|
-
foo.rb
|
74
|
-
foo.html
|
75
|
-
bar
|
76
|
-
baz/lol.txt
|
77
|
-
foo/.hidden
|
78
|
-
foo/bar.rb
|
79
|
-
foo/bar.html
|
80
|
-
foo/bar/baz.pdf
|
81
|
-
foobar/.hidden
|
82
|
-
foobar/baz.txt
|
83
|
-
foobar/baz.rb
|
84
|
-
foobar/baz/lol.wut
|
85
|
-
a/a.yuss
|
86
|
-
a/a/a/a/a.yuss
|
87
|
-
spec/nope
|
88
|
-
spec/noignore
|
89
|
-
FILES
|
90
|
-
files.each do |file|
|
91
|
-
FileUtils.mkdir_p File.dirname(file)
|
92
|
-
FileUtils.touch file
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
def untracked
|
97
|
-
`git status -uall --porcelain`.gsub(/^\?\? /m, '').split(/\n/)
|
98
|
-
end
|
99
|
-
|
100
|
-
def git_files
|
101
|
-
Dir.glob('.git/**/*', File::FNM_DOTMATCH).
|
102
|
-
select{ |f| File.symlink?(f) || File.file?(f) }.sort
|
103
|
-
end
|
104
|
-
|
105
|
-
def all_files
|
106
|
-
Dir.glob('**/*', File::FNM_DOTMATCH).
|
107
|
-
select{ |f| File.symlink?(f) || File.file?(f) }.sort
|
108
|
-
end
|
109
|
-
end
|
@@ -1,93 +0,0 @@
|
|
1
|
-
require 'globby'
|
2
|
-
|
3
|
-
describe Globby do
|
4
|
-
it "should support chaining" do
|
5
|
-
files = files(%w{foo/bar.rb foo/baz.rb foo/c/bar.html foo/c/c/bar.rb})
|
6
|
-
expect(Globby.select(%w{*rb}, files).
|
7
|
-
reject(%w{baz*}).
|
8
|
-
select(%w{c})).to eq %w{foo/c/c/bar.rb}
|
9
|
-
end
|
10
|
-
|
11
|
-
describe ".select" do
|
12
|
-
context "a blank line" do
|
13
|
-
it "should return nothing" do
|
14
|
-
files = files("foo")
|
15
|
-
expect(Globby.select([""], files)).to eq []
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
context "a comment" do
|
20
|
-
it "should return nothing" do
|
21
|
-
files = files("foo")
|
22
|
-
expect(Globby.select(["#"], files)).to eq []
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
context "a pattern ending in a slash" do
|
27
|
-
it "should return a matching directory's contents" do
|
28
|
-
files = files(%w{foo/bar/baz foo/bar/baz2})
|
29
|
-
expect(Globby.select(%w{bar/}, files)).to eq %w{foo/bar/baz foo/bar/baz2}
|
30
|
-
end
|
31
|
-
|
32
|
-
it "should ignore symlinks and regular files" do
|
33
|
-
files = files(%w{foo/bar bar/baz})
|
34
|
-
expect(Globby.select(%w{bar/}, files)).to eq %w{bar/baz}
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
context "a pattern starting in a slash" do
|
39
|
-
it "should return only root glob matches" do
|
40
|
-
files = files(%w{foo/bar bar/foo})
|
41
|
-
expect(Globby.select(%w{/foo}, files)).to eq %w{foo/bar}
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
context "a pattern with a *" do
|
46
|
-
it "should return matching files" do
|
47
|
-
files = files(%w{foo/bar foo/baz})
|
48
|
-
expect(Globby.select(%w{*z}, files)).to eq %w{foo/baz}
|
49
|
-
end
|
50
|
-
|
51
|
-
it "should not glob slashes" do
|
52
|
-
files = files(%w{foo/bar foo/baz})
|
53
|
-
expect(Globby.select(%w{foo*bar}, files)).to eq []
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
context "a pattern with a ?" do
|
58
|
-
it "should return matching files" do
|
59
|
-
files = files(%w{foo/bar foo/baz})
|
60
|
-
expect(Globby.select(%w{b?z}, files)).to eq %w{foo/baz}
|
61
|
-
end
|
62
|
-
|
63
|
-
it "should not glob slashes" do
|
64
|
-
files = files(%w{foo/bar foo/baz})
|
65
|
-
expect(Globby.select(%w{foo?bar}, files)).to eq []
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
context "a pattern with a **" do
|
70
|
-
it "should match directories recursively" do
|
71
|
-
files = files(%w{foo/bar foo/baz foo/c/bar foo/c/c/bar})
|
72
|
-
expect(Globby.select(%w{foo/**/bar}, files)).to eq %w{foo/bar foo/c/bar foo/c/c/bar}
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
context "a pattern with bracket expressions" do
|
77
|
-
it "should return matching files" do
|
78
|
-
files = files(%w{boo fob f0o foo/bar poo/baz})
|
79
|
-
expect(Globby.select(%w{[e-g][0-9[:alpha:]][!b]}, files)).to eq %w{f0o foo/bar}
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
def files(files)
|
85
|
-
files = Array(files)
|
86
|
-
files.sort!
|
87
|
-
dirs = files.grep(/\//).map(&:dup).inject([]) { |ary, file|
|
88
|
-
ary << file while file.sub!(/[^\/]+\z/, '')
|
89
|
-
ary
|
90
|
-
}.uniq.sort
|
91
|
-
Globby::GlObject.new files, dirs
|
92
|
-
end
|
93
|
-
end
|
data/zeus.json
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"command": "ruby -rubygems -r./custom_plan -eZeus.go",
|
3
|
-
|
4
|
-
"plan": {
|
5
|
-
"boot": {
|
6
|
-
"default_bundle": {
|
7
|
-
"development_environment": {
|
8
|
-
"prerake": {"rake": []},
|
9
|
-
"runner": ["r"],
|
10
|
-
"console": ["c"],
|
11
|
-
"server": ["s"],
|
12
|
-
"generate": ["g"],
|
13
|
-
"destroy": ["d"],
|
14
|
-
"dbconsole": []
|
15
|
-
},
|
16
|
-
"test_environment": {
|
17
|
-
"test_helper": {"test": ["rspec", "testrb"]}
|
18
|
-
}
|
19
|
-
}
|
20
|
-
}
|
21
|
-
}
|
22
|
-
}
|