squared 0.5.18 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c64d1ba5b8781c76d0dbbccf6cbedf66e217043fbfd2bc33220a8c2d60baa82
4
- data.tar.gz: 0566e40b09f80693e1abbbf7e97de7bb92e952d5d2890be37340da34e0f24be3
3
+ metadata.gz: ed078210213186745643650b4a73f7f376b5aba7033643c850b48d555c198501
4
+ data.tar.gz: d4d8c0e6308f3bdc3aca66891980259ad52ce11f3a53112c7a22ae4de9e31f40
5
5
  SHA512:
6
- metadata.gz: 4ff0e0a44837f6fec6016680564f784968e0627367e727dfd30d1533f951f437b57ca746cc5876aa97ae05c11bc89ca79b149783e9082e15adc7d437e95c87e1
7
- data.tar.gz: ac233a17a56d35be1008b1e598d875fe173e85d412eafd13477536a469da1de9e06f16c245c02c5e568b8250a4a8bbf2693b9859fc3e3231ac43ff0a661371e6
6
+ metadata.gz: fcf308f894ee49566103575561b74459afc1aa7e03af8d5c5397c7bb7432dfce996cbb1291f4f81af792d5b1dd8ed6a9075ce7b2fab6f41dca0c56431e38b78c
7
+ data.tar.gz: 19f25542363b33fa567cbfcb0267c79fbc55a313ce0fba8ab25ec17dd43f276b004b00304e8bfe38dba1338a2e554170a8f1535d1bdc5981407fae6e9bff2bf8
data/CHANGELOG.md CHANGED
@@ -1,106 +1,97 @@
1
1
  # Changelog
2
2
 
3
- ## [0.5.18] - 2025-11-25
4
-
5
- ### Fixed
6
-
7
- - See `0.5.18`.
8
-
9
- ## [0.4.32] - 2025-11-25
10
-
11
- ### Fixed
12
-
13
- - Git method commit did not include --dry-run with add command.
14
- - JoinSet method include? did not always search to start of delimiter.
15
- - Config viewer did not check for a readable package registry document.
16
- - Powershell executable did not check for alternate path location.
17
-
18
- ## [0.5.17] - 2025-11-22
19
-
20
- ### Fixed
21
-
22
- - See `0.4.31`.
23
-
24
- ## [0.4.31] - 2025-11-22
25
-
26
- ### Changed
27
-
28
- - Project base attribute project was converted into an accessor.
29
- - Ruby command flag is given precedence to a program file.
30
-
31
- ### Fixed
32
-
33
- - Repo application tasks are not created on Windows.
34
- - Repo module used conflicting REPO_URL with Repo application.
35
- - Project task outdated did not check pass and only exclusions.
36
- - Workspace static method resolve did nothing when given a String.
37
- - Project base run command types did not include Struct.
38
- - Project change directory context did not always restore when raised.
39
- - Ruby file method attributes did not always return nil.
40
- - JoinSet with a delimiter did not report correct size.
41
-
42
- ## [0.5.16] - 2025-11-14
43
-
44
- ### Fixed
45
-
46
- - See `0.4.30`.
47
-
48
- ## [0.4.30] - 2025-11-14
3
+ ## [0.6.0] - 2025-10-31
49
4
 
50
5
  ### Added
51
6
 
52
- - Config viewer can read items by index in an Array.
53
-
54
- ### Fixed
55
-
56
- - Node command add uses event name "add" and not "depend".
57
- - Node command add did not include packages with Yarn and PNPM.
58
- - Git method revbuild did not splat build arguments.
59
-
60
- ## [0.5.15] - 2025-11-08
61
-
62
- ### Fixed
63
-
64
- - See `0.4.29`.
65
-
66
- ## [0.4.29] - 2025-11-08
67
-
68
- ### Fixed
69
-
70
- - OptionPartition was created by mistake and is unreliable in every way.
71
-
72
- ## [0.5.14] - 2025-11-08
73
-
74
- ### Fixed
75
-
76
- - See `0.4.28`.
77
-
78
- ## [0.4.28] - 2025-11-08
79
-
80
- ### Fixed
81
-
82
- - Project base method build as arrays parsed unrelated arguments.
83
- - OptionPartition method arg? does not check after "--" delimiter.
84
- - OptionPartition did not support duplicate values after "--" delimiter.
85
- - OptionPartition method opt? did not type check for String.
86
-
87
- ## [0.5.13] - 2025-11-05
88
-
89
- ### Fixed
90
-
91
- - See `0.4.27`.
92
-
93
- ## [0.4.27] - 2025-11-05
7
+ - Docker command compose action create was implemented.
8
+ - Docker command compose action ps was implemented.
9
+ - Docker command compose action ps is interactive.
10
+ - Project base asdf commands [latest|where|update] were implemented.
11
+ - Pip command options were updated to 25.2.
12
+ - Command line programs who do not assign with equals are supported.
13
+ - Docker command ls with column formatting was implemented.
14
+ - Git command stash action staged and worktree were implemented.
15
+ - Git command diff action files can output to a patch file.
16
+ - Repo task init with REPO_Y can auto-accept overwrite confirmation.
17
+ - Caller locations for errors can be excluded using ARG[:BACKTRACE].
18
+ - Node command package action reinstall was implemented.
19
+ - Node class method and command tsc was implemented.
20
+ - Python command pip action reinstall was implemented.
21
+ - Project command options can be stored by class ref and project name.
22
+ - Bundler command config is interactive.
23
+ - Ruby method bundle supports stored command options.
24
+ - Ruby method rake supports stored command options.
25
+ - Ruby method ruby supports stored command options.
26
+ - Ruby method gem supports stored command options.
27
+ - Python method pip supports stored command options.
28
+ - Python command pip action wheel was implemented.
29
+ - Ruby method irb supports stored command options.
30
+ - Ruby command gem action command was implemented.
31
+ - ENV supplementary command options can be space delimited.
32
+ - Project command options can extend other stored options.
33
+ - Ruby command gem action outdated can update without being interactive.
34
+ - Ruby command gem action update system can accept a specific version.
35
+ - Ruby command gem action outdated supports threading.
36
+ - Git command grep was implemented.
37
+ - Common format bright colors fallback to standard colors when not enabled.
38
+ - Project base command unpack action gz was implemented.
39
+ - Common format defined String instance method subhint.
40
+ - Application readers [exception|pipe|verbose|warning] were converted into accessors.
41
+ - Node private projects can publish entire workspace with tags.
42
+ - Node command outdated can select a range of packages to update.
43
+ - Gem command outdated can select a range of packages to update.
44
+ - Python command outdated can select a range of packages to update.
45
+ - Node command outdated option diff was implemented.
46
+ - Bundler command outdated can select a range of packages to update.
47
+ - Common prompt method choice can select all items with "\*".
48
+ - Node command bump can auto-commit package.json using GIT_MESSAGE.
49
+ - Git command options were updated to version 2.51.
94
50
 
95
51
  ### Changed
96
52
 
97
- - OptionPartition does not add quotes when an option flag is detected.
98
- - Common shell method argument option only parses options with values.
99
- - Shell options with empty flags are treated as quoted strings.
100
-
101
- ### Fixed
102
-
103
- - OptionPartition did not detect flags with middle dashes.
53
+ - Git method source will raise error when checking exit status.
54
+ - Date gem is no longer globally required.
55
+ - Global task git:all was removed.
56
+ - Common base method as_a was relocated to Utils.
57
+ - Python command build and publish detects only one backend.
58
+ - Docker command compose action ps was renamed service.
59
+ - Docker command image action list was renamed ls.
60
+ - Project base method success? conditionally calls print_success method.
61
+ - Error classes were not specified for invalid operation.
62
+ - Common format methods stripstyle and stripext are String instance methods.
63
+ - Common format method alias puts_oe was removed.
64
+ - Git commands without a valid action will exit with error status.
65
+ - Errno exceptions are used in place of SystemCallError.
66
+ - Common format method raise_error defaults to RuntimeError.
67
+ - OptionPartition delegator method delete_at was renamed remove_at.
68
+ - Node event name "publish" was renamed to "npm:publish".
69
+ - Project task run with a Method passes self as first argument.
70
+ - Ruby command check was removed.
71
+ - Ruby method gem! was renamed gem.
72
+ - Ruby methods ruby and irb first argument was converted into kwargs.
73
+ - Ruby method rake executes all tasks in one run command.
74
+ - Ruby project file methods return nil instead of false.
75
+ - Ruby commands [exec|cache|config] were relocated under bundle namespace.
76
+ - Ruby command gem action update without arguments is not modified.
77
+ - Ruby command install was replaced with reinstall under bundle namespace.
78
+ - Ruby command update was relocated under bundle namespace.
79
+ - Common prompt confirm timeout was revised for non-immediate responses.
80
+ - Project relative paths are stripped from banner when context is displayed.
81
+ - Workspace module Support extend submodules private methods.
82
+ - Workspace method add passes parent through Project constructor.
83
+ - Project base method run_s uses last argument for ENV hash.
84
+ - Project base method inject does not exit program when raised.
85
+ - Reline gem is installed only when using at least Ruby 3.0.
86
+ - Python method install arguments strategy and user were removed.
87
+ - Project command outdated does not support threading when interactive.
88
+ - Project base accessor global was converted into a reader and setter.
89
+ - Repo build can simultaneously use script and run through REPO_BUILD.
90
+ - Repo static method read_manifest was made an instance method named repo_manifest.
91
+
92
+ ### Fixed
93
+
94
+ - Node task update did not check equivalent ENV install options.
104
95
 
105
96
  ## [0.5.12] - 2025-10-31
106
97
 
@@ -1286,11 +1277,7 @@
1286
1277
 
1287
1278
  - Changelog was created.
1288
1279
 
1289
- [0.5.17]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.17
1290
- [0.5.16]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.16
1291
- [0.5.15]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.15
1292
- [0.5.14]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.14
1293
- [0.5.13]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.13
1280
+ [0.6.0]: https://github.com/anpham6/squared-ruby/releases/tag/v0.6.0
1294
1281
  [0.5.12]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.12
1295
1282
  [0.5.11]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.11
1296
1283
  [0.5.10]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.10
@@ -1304,11 +1291,6 @@
1304
1291
  [0.5.2]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.2-ruby
1305
1292
  [0.5.1]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.1-ruby
1306
1293
  [0.5.0]: https://github.com/anpham6/squared-ruby/releases/tag/v0.5.0-ruby
1307
- [0.4.31]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.31
1308
- [0.4.30]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.30
1309
- [0.4.29]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.29
1310
- [0.4.28]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.28
1311
- [0.4.27]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.27
1312
1294
  [0.4.26]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.26
1313
1295
  [0.4.25]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.25
1314
1296
  [0.4.24]: https://github.com/anpham6/squared-ruby/releases/tag/v0.4.24
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # squared 0.5
1
+ # squared 0.6
2
2
 
3
3
  * [source](https://github.com/anpham6/squared-ruby)
4
4
  * [docs](https://squared.readthedocs.io)
@@ -14,6 +14,7 @@
14
14
  | 2025-06-16 | 0.5.0 | 2.5.0 | 3.4.3 |
15
15
  | ---------- | ----- | ----- | ----- |
16
16
  | 2025-08-23 | 0.5.5 | | 3.4.5 |
17
+ | 2025-10-31 | 0.6.0 | | 3.4.7 |
17
18
 
18
19
  The range chart indicates the latest Ruby tested against at the time of release.
19
20
 
@@ -23,9 +24,23 @@ The range chart indicates the latest Ruby tested against at the time of release.
23
24
  gem install squared
24
25
  ```
25
26
 
27
+ ### Optional
28
+
29
+ * [Repo](https://source.android.com/docs/setup/reference/repo)
30
+ * https://github.com/anpham6/squared-repo
31
+ * Python 3.6
32
+ * Not compatible with Windows
33
+
34
+ ```sh
35
+ mkdir -p ~/.bin
36
+ PATH="${HOME}/.bin:${PATH}"
37
+ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo
38
+ chmod a+rx ~/.bin/repo
39
+ ```
40
+
26
41
  ## Example - Rakefile
27
42
 
28
- Projects from any accessible folder can be added relative to the parent directory or absolutely. Missing projects will simply be excluded from the task runner.
43
+ Projects from any accessible folder can be added relative to the parent directory (e.g. *REPO_ROOT*) or absolutely. The same Rakefile can also manage other similarly cloned `Repo` repositories remotely by setting the `REPO_ROOT` environment variable to the location. Missing projects will simply be excluded from the task runner.
29
44
 
30
45
  ```ruby
31
46
  require "squared"
@@ -41,6 +56,14 @@ require "squared/app" # All workspace related mod
41
56
 
42
57
  # NODE_ENV = production
43
58
 
59
+ # REPO_ROOT = /workspaces |
60
+ # REPO_HOME = /workspaces/squared | Dir.pwd
61
+ # rake = /workspaces/squared/Rakefile | main?
62
+ # OR
63
+ # REPO_ROOT = /workspaces | Dir.pwd
64
+ # rake = /workspaces/Rakefile |
65
+ # REPO_HOME = /workspaces/squared | main: "squared"
66
+
44
67
  # pathname = /workspaces/pathname
45
68
  # optparse = /workspaces/optparse
46
69
  # log = /workspaces/logger
@@ -55,6 +78,7 @@ require "squared/app" # All workspace related mod
55
78
  Workspace::Application
56
79
  .new(Dir.pwd, main: "squared") # Dir.pwd? (main? is implicitly basename)
57
80
  .banner("group", "project", styles: ["yellow", "black"], border: "bold") # name | project | path | ref | group? | parent? | version?
81
+ .repo("https://github.com/anpham6/squared-repo", "nightly", script: ["build:dev", "build:prod"], ref: :node) # Repo (optional)
58
82
  .run("rake install", ref: :ruby)
59
83
  .depend(false, group: "default")
60
84
  .clean("rake clean", group: "default")
@@ -119,20 +143,59 @@ Workspace::Application
119
143
  # android = /workspaces/android-docs
120
144
  # chrome = /workspaces/chrome-docs
121
145
 
146
+ # ...symbol?, string, ...string?, ...symbol?
147
+ # extend name args project
148
+
149
+ Node = Workspace::Project::Node # tsc
150
+ Node.options("build:dev", "target=es2022", project: "tsconfig.json") # :node (ref)
151
+ Node.options("build:dev", "outDir=tmp", :squared) # squared (project name)
152
+
153
+ Ruby = Workspace::Project::Ruby # ruby | gem | rake | bundle | irb
154
+ Ruby.options("lint", "rubocop", opts: ["gemfile=Gemfile"]) # :ruby
155
+ Ruby.options("lint", "--parallel", :squared)
156
+
157
+ Python = Workspace::Project::Python # pip
158
+ Python.options("build", opts: ["r=requirements.txt"]) # :python
159
+ Python.options(:build, "build:dev", opts: ["no-deps"])
160
+
122
161
  Workspace::Application
123
- .new(ENV["SQUARED_HOME"], prefix: "rb", common: false) # Local styles
162
+ .new(ENV["SQUARED_HOME"], prefix: "rb", common: false) # Local styles
124
163
  .group("ruby", "default", run: "rake build", copy: "rake install", clean: "rake clean", ref: :ruby, override: {
125
164
  pathname: {
126
- run: "rake compile" # rake rb:pathname:build
165
+ run: "rake compile" # rake rb:pathname:build
127
166
  }
128
167
  })
129
- .with(:python, editable: false) do # ref=Symbol | group=String
130
- banner([:name, ": ", :version], "path") # chrome-docs: 0.1.0 | /workspaces/chrome-docs
131
- doc("make html") # rake rb:doc:python
132
- run(false) # rake rb:build:python (disabled)
133
- exclude(%i[base git]) # Project::Git.ref (superclass)
134
- add("android-docs", "android") # rake rb:android:doc
135
- add("chrome-docs", "chrome") # rake rb:chrome:doc
168
+ .add("squared") do
169
+ apply :run, proc { # rake rb:squared:build
170
+ tsc(with: scriptname || "build:dev", verbose: true) # Repo (global)
171
+ # OR
172
+ tsc("target=es2022", "outDir=tmp", project: "tsconfig.json") # 1
173
+ tsc("clean=true", "./sqd/tsconfig.json", build: true) # 2
174
+ run("npm run build:dev", { "RUBYOPT" => "-W2" }, from: :run) # 3
175
+
176
+ # Parallel
177
+ [
178
+ Thread.new { tsc(sync: false) },
179
+ Thread.new { tsc(sync: false) },
180
+ Thread.new { run(sync: false) }
181
+ ]
182
+ .each(&:join)
183
+ }
184
+ apply :lint, proc {
185
+ bundle("exec", "-A --cache=true", with: "lint", verbose: true) # bundle exec --gemfile='/squared/Gemfile' rubocop --parallel -A --cache=true
186
+ }
187
+ end
188
+ .with(:python, editable: false) do # ref=Symbol | group=String
189
+ banner([:name, ": ", :version], "path") # chrome-docs: 0.1.0 | /workspaces/chrome-docs
190
+ doc("make html") # rake rb:doc:python
191
+ run(false) # rake rb:build:python (disabled)
192
+ exclude(%i[base git]) # Project::Git.ref (superclass)
193
+ add("android-docs", "android") # rake rb:android:doc
194
+ add("chrome-docs", "chrome") do # rake rb:chrome:doc
195
+ apply :run, proc {
196
+ pip("wheel", with: "build:dev") # pip wheel -r '/chrome-docs/requirements.txt' --no-deps
197
+ }
198
+ end
136
199
  end
137
200
  .style("inline", "bold")
138
201
  .build
@@ -473,28 +536,28 @@ Non-task:
473
536
 
474
537
  Most project classes will inherit from `Git` which enables these tasks:
475
538
 
476
- | Task | Git | Command |
477
- | :--------- | :--------------- | :-------------------------------------------- |
478
- | branch | branch | create track delete move copy list current |
479
- | checkout | checkout | commit branch track detach path |
480
- | commit | commit | add all amend amend-orig fixup |
481
- | diff | diff | head branch files view between contain |
482
- | fetch | fetch | origin remote all |
483
- | files | ls-files | cached modified deleted others |
484
- | git | | add blame clean mv revert rm status |
485
- | log | log | view between contain |
486
- | merge | merge | commit no-commit send |
487
- | pull | pull | origin remote all |
488
- | rebase | rebase | branch onto send |
489
- | refs | ls-remote --refs | heads tags remote |
490
- | reset | reset | commit index patch mode undo |
491
- | restore | restore | source staged worktree |
492
- | rev | rev | commit build output |
493
- | show | show | format oneline textconv |
494
- | stash | stash | push pop apply branch drop clear list all |
495
- | submodule | submodule | status update branch url sync |
496
- | switch | switch | branch create detach |
497
- | tag | tag | add sign delete list |
539
+ | Task | Git | Command |
540
+ | :--------- | :--------------- | :-------------------------------------------------------- |
541
+ | branch | branch | create track delete move copy list current |
542
+ | checkout | checkout | commit branch track detach path |
543
+ | commit | commit | add all amend amend-orig fixup |
544
+ | diff | diff | head branch files view between contain |
545
+ | fetch | fetch | origin remote all |
546
+ | files | ls-files | cached modified deleted others |
547
+ | git | | add blame clean grep mv revert rm status |
548
+ | log | log | view between contain |
549
+ | merge | merge | commit no-commit send |
550
+ | pull | pull | origin remote all |
551
+ | rebase | rebase | branch onto send |
552
+ | refs | ls-remote --refs | heads tags remote |
553
+ | reset | reset | commit index patch mode undo |
554
+ | restore | restore | source staged worktree |
555
+ | rev | rev | commit build output |
556
+ | show | show | format oneline textconv |
557
+ | stash | stash | push pop apply branch drop clear list all staged worktree |
558
+ | submodule | submodule | status update branch url sync |
559
+ | switch | switch | branch create detach |
560
+ | tag | tag | add sign delete list |
498
561
 
499
562
  You can disable all of them at once using the `exclude` property.
500
563
 
@@ -609,7 +672,7 @@ LOG_LEVEL # See gem "logger"
609
672
 
610
673
  ### Git
611
674
 
612
- * Version: [2.50](https://github.com/git/git/blob/v2.50.0/Documentation/RelNotes/2.50.0.adoc)
675
+ * Version: [2.51](https://github.com/git/git/blob/v2.51.0/Documentation/RelNotes/2.51.0.adoc)
613
676
 
614
677
  ```sh
615
678
  GIT_OPTIONS=q,strategy=ort # all
@@ -707,58 +770,27 @@ Workspace::Application
707
770
 
708
771
  ### Repo
709
772
 
710
- * [Repo](https://source.android.com/docs/setup/reference/repo)
711
- * https://github.com/anpham6/squared-repo
712
- * Python 3.6
713
- * Not compatible with Windows
714
-
715
- ```sh
716
- mkdir -p ~/.bin
717
- PATH="${HOME}/.bin:${PATH}"
718
- curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo
719
- chmod a+rx ~/.bin/repo
720
- ```
721
-
722
- ```ruby
723
- # REPO_ROOT = /workspaces |
724
- # REPO_HOME = /workspaces/squared | Dir.pwd
725
- # rake = /workspaces/squared/Rakefile | main?
726
- #
727
- # OR
728
- #
729
- # REPO_ROOT = /workspaces | Dir.pwd
730
- # rake = /workspaces/Rakefile |
731
- # REPO_HOME = /workspaces/squared | main: "squared"
732
-
733
- Workspace::Application
734
- .new(main: "squared")
735
- .repo("https://github.com/anpham6/squared-repo", "nightly", script: ["build:dev", "prod"], ref: :node)
736
- .add("squared", script: ["build:stage1", "build:stage2"])
737
- .build
738
- ```
739
-
740
- These global options also can target the application main suffix `${NAME}`. (e.g. *REPO_ROOT_SQUARED*)
773
+ These global options also can target the application main suffix `${NAME}`. (e.g. REPO_ROOT_SQUARED)
741
774
 
742
775
  ```sh
743
776
  REPO_ROOT # parent dir
744
777
  REPO_HOME # project dir (main)
745
- REPO_BUILD # run,script
778
+ REPO_BUILD # script,run (e.g. build:dev | build:dev,make install | make)
746
779
  REPO_GROUP # string
747
780
  REPO_REF # e.g. ruby,node
748
781
  REPO_DEV # pattern,0,1
749
782
  REPO_PROD # pattern,0,1
750
783
  REPO_WARN # 0,1
751
784
  REPO_SYNC # 0,1
752
- REPO_GIT # manifest repository
785
+ REPO_URL # manifest repository
753
786
  REPO_MANIFEST # e.g. latest,nightly,prod
754
787
  REPO_GROUPS # e.g. base,prod,docs
755
788
  REPO_STAGE # 0,1,2,3,4
756
789
  REPO_SUBMODULLES # 0,1
790
+ REPO_Y # 0,1
757
791
  REPO_TIMEOUT # confirm dialog (seconds)
758
792
  ```
759
793
 
760
- Other similarly cloned `Repo` repositories can be managed remotely by setting the `REPO_ROOT` environment variable to the location.
761
-
762
794
  ## LICENSE
763
795
 
764
796
  BSD 3-Clause
@@ -17,6 +17,7 @@ module Squared
17
17
  GRAPH: ['|', '-', '|', '\\', '-'].freeze,
18
18
  BORDER: ['|', '-', '-', '-', '-', '-', '|', '|', '-', '-'].freeze,
19
19
  VIEW: 'view',
20
+ BACKTRACE: $DEBUG || !$VERBOSE.nil?,
20
21
  LEVEL: ENV.fetch('LOG_LEVEL', 0).to_i,
21
22
  COLOR: ENV.fetch('NO_COLOR', '').empty?
22
23
  }
@@ -97,27 +98,5 @@ module Squared
97
98
  VAR[:theme].each_value { |val| val.freeze.each_value(&:freeze) }
98
99
  VAR.freeze
99
100
  end
100
-
101
- module_function
102
-
103
- def as_a(obj, *meth, flat: nil, compact: false, &blk)
104
- return [] if obj.nil?
105
-
106
- unless obj.is_a?(::Array)
107
- obj = if obj.respond_to?(:to_ary)
108
- obj.to_ary
109
- elsif obj.respond_to?(:to_a) && !obj.is_a?(::Hash) && (val = obj.to_a).is_a?(::Array)
110
- val
111
- else
112
- [obj]
113
- end
114
- end
115
- obj = flat.is_a?(::Numeric) ? obj.flatten(flat) : obj.flatten if flat
116
- obj = obj.compact if compact
117
- obj = obj.map(&meth.shift) until meth.empty?
118
- return obj unless block_given?
119
-
120
- obj.select(&blk)
121
- end
122
101
  end
123
102
  end