Comments (5)
Amazing, I'm glad it helped you! Thank you for your feedback @brabanod π€ really appreciate it!
from arkana.
Seems like the code that is causing this is the regular expression in lib/arkana/models/type.rb
when /^\d+$/
INTEGER
Is there any way to prevent arcana from doing this? I could of course add a character in front of my value like a0001
so that arkana will handle it like a string, however then I have to remove that character again in the code. It's not a very nice solution. Are there any solutions known to this problems, which can be configured directly in arkana?
from arkana.
Hi @brabanod π
It seems like you're the first person to request this type of behavior. Aside from the solution you proposed of adding an extra character, I see two other solutions that could be built into Arkana itself:
- Add an env var that, when set, changes this default behavior
- Compare if the string being read (
"0001"
) is equal to its numeric representation after converting it (e.g.1
in your case). If it's not, parse it as a String instead.
What do you think of these solutions? I lean towards less configurations (thus, less env vars), but not sure if the 2nd solution has any pitfalls I'm not seeing, that could potentially break people's code if they're using it π€ perhaps thinking of edge cases like massive numbers (larger than 64-bit) could break this unintentionally? What about negative numbers? I suppose these are already not supported anyway.
Let me know what you think :)
from arkana.
I opened a PR with the 2nd implementation above, and added extensive tests to cover the scenarios I could think of. Let me know if that works for you @brabanod π
from arkana.
Hey @rogerluan, sorry for the late response!
The second solution looks perfect. Thank you very much for taking the time to implement it, really appreciate it! Just tested it with the latest version and everything works perfectly fine π
from arkana.
Related Issues (20)
- Required Ruby version HOT 6
- Issues with Xcode Build Phases Script HOT 4
- Document why using Arkana in a Build Phase Run Script is discouraged HOT 9
- Add a .lock file to track when/if Arkana config or values change.
- Add support to Integer env vars
- I ran arkana⦠what's the next step? HOT 3
- license compatibility issue: `colorize` HOT 2
- The key is getting corrupted when it contains '$' HOT 3
- Add a feature to only build for a selected environment HOT 12
- Arkana fails on CI due to .env file missing, even when env vars are all present in CI HOT 7
- SPM fails to install this project (Package.swift doesn't exist) HOT 5
- Undefined symbols for architecture arm64 (On new target)
- Add a section on guidance of ensuring running arkana command before build every time HOT 2
- [Request] Support both Swift and ObjC HOT 1
- Make available via Homebrew HOT 1
- Don't generate unnecessary extensions HOT 1
- Difficulty following spm setup instructions HOT 1
- Missing package product 'ArkanaKeys' (arkana 1.5.0) HOT 3
- Failed to load command: arkana - Undefined method capitalize_first_letter HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arkana.