rexer 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 564e86a618538937d2e68d85f1b625a8fa3ebddc8e4891fb12a4598eb2f944a5
4
- data.tar.gz: 4e21379d1dae8ee68c301ee0f4be43a1034b585af097a9713ae3b238a8795ffe
3
+ metadata.gz: dd717744bdbbcbb0470f21f2cf7c8345b4852901a7cd86088751ca971d07b5cf
4
+ data.tar.gz: ec7eac6cb58e0eed5ad5ad58de7479fc6223521497deb49728fb62a6fc2616dd
5
5
  SHA512:
6
- metadata.gz: f542f39676156e026985ab85853133e0efe09681cf8671bf8f2370fa9f0c2301a5d0f7422cdc042219b7475f2e15b28ec35807ae12285c132dba8e4729fc9203
7
- data.tar.gz: 4632bde598651690ce5b685d7d80b657ef6567fe074ce392575cf87f8b705a4ce6f3b75495a74b311d2a1b6949fca65b0a660c1b9c653b31a7086b7b4d3decf3
6
+ metadata.gz: f9db79d00f966ffa25c12cc5978103169e796f621e7e5e7dc842225067dbce3dcded6453cd61caa15e13434725bfc74da416b9c196a287279627359de3db5e2d
7
+ data.tar.gz: 1d02b36a1baf9a5350d6729dd565f0cad4327a99c07ed28694d89f34253f2fcc8c08dd7bb68e978a4ace19c9ff3985d45a1041595c9c05dc8e40226484da5f84
data/README.md CHANGED
@@ -9,13 +9,13 @@ It is mainly aimed at helping with the development of Redmine and its plugins, a
9
9
 
10
10
  ## Installation
11
11
 
12
- Install the gem and add to the application's Gemfile by executing:
13
-
14
- bundle add rexer
12
+ ```
13
+ gem install rexer
14
+ ```
15
15
 
16
- If bundler is not being used to manage dependencies, install the gem by executing:
16
+ ## Supported Redmine
17
17
 
18
- gem install rexer
18
+ Rexer is tested with Redmine v5.1 and trunk.
19
19
 
20
20
  ## Usage
21
21
 
@@ -55,6 +55,7 @@ This command uninstalls the extensions and deletes the `.extensions.lock` file.
55
55
  $ rex
56
56
  Commands:
57
57
  rex help [COMMAND] # Describe available commands or one specific command
58
+ rex envs # Show the list of defined environments in .extensions.rb
58
59
  rex install [ENV] # Install extensions for the specified environment
59
60
  rex state # Show the current state of the installed extensions
60
61
  rex switch [ENV] # Uninstall extensions for the currently installed environment and install extensions for the specified environment
@@ -125,20 +126,26 @@ end
125
126
 
126
127
  ## Developing
127
128
 
128
- ### Running integration tests
129
+ ### Running tests
129
130
 
130
131
  First, you need to build the docker image for the integration tests.
131
132
 
132
133
  ```
133
- rake rexer:test:build_integration_test_image
134
+ rake test:prepare_integration
134
135
  ```
135
136
 
136
- Then, you can run the integration tests.
137
+ Then, you can run all tests.
137
138
 
138
139
  ```
139
140
  rake test
140
141
  ```
141
142
 
143
+ Or, you can only the integration tests as follows.
144
+
145
+ ```
146
+ rake test:integration
147
+ ```
148
+
142
149
  ### Formatting and Linting code
143
150
 
144
151
  This project uses [Standard](https://github.com/standardrb/standard) for code formatting and linting. You can format and check the code by running the following commands.
data/lib/rexer/cli.rb CHANGED
@@ -31,6 +31,11 @@ module Rexer
31
31
  Commands::State.new.call
32
32
  end
33
33
 
34
+ desc "envs", "Show the list of defined environments in .extensions.rb"
35
+ def envs
36
+ Commands::Envs.new.call
37
+ end
38
+
34
39
  desc "version", "Show Rexer version"
35
40
  def version
36
41
  puts Rexer::VERSION
@@ -0,0 +1,24 @@
1
+ module Rexer
2
+ module Commands
3
+ class Envs
4
+ def initialize
5
+ @definition = Definition.load_data
6
+ end
7
+
8
+ def call
9
+ defined_envs.each do
10
+ puts _1
11
+ end
12
+ end
13
+
14
+ private
15
+
16
+ attr_reader :definition
17
+
18
+ def defined_envs
19
+ all_envs = definition.plugins.map(&:env) + definition.themes.map(&:env)
20
+ all_envs.uniq
21
+ end
22
+ end
23
+ end
24
+ end
@@ -2,7 +2,14 @@ module Rexer
2
2
  module Extension
3
3
  module Theme
4
4
  def self.dir
5
- Pathname.new("themes")
5
+ public_themes = Pathname.pwd.join("public", "themes")
6
+
7
+ if public_themes.exist?
8
+ # When Redmine version is v5.1 or older, public/themes is used.
9
+ public_themes
10
+ else
11
+ Pathname.new("themes")
12
+ end
6
13
  end
7
14
 
8
15
  class Base
data/lib/rexer/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rexer
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rexer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katsuya Hidaka
@@ -69,6 +69,7 @@ files:
69
69
  - exe/rex
70
70
  - lib/rexer.rb
71
71
  - lib/rexer/cli.rb
72
+ - lib/rexer/commands/envs.rb
72
73
  - lib/rexer/commands/install.rb
73
74
  - lib/rexer/commands/state.rb
74
75
  - lib/rexer/commands/switch.rb