Comments (3)
To not break customer apps, I would wrap up your old hashie based interface in some kind of a deprecation pattern and release a point release with the deprecations before simply changing the interface.
Something like this:
class NewConfig
def initialize(old_config)
@old_config = old_config
end
# Put config interface here
def method_missing(name, *args, &block)
if @old_config.respond_to?(name)
puts "Calling `#{name}` on #{self} is deprecated and will be removed in <version>, please see <URL> for alternatives."
puts "`#{name}` called #{caller_locations.first}"
@old_config.send(name, *args, &block)
else
super
end
end
end
You can initialize it like this:
old_config = Hashie::Mash.new
config = NewConfig.new(old_config)
config["foo"]
Calling `[]` on #<NewConfig:0x007fcb9d1b2180> is deprecated and will be removed in <version>, please see <URL> for alternatives.
`[]` called (irb):72:in `irb_binding'
Now if your new config is missing an interface the gem will complain loudly. I would point the URL to an issue in your own project and have it say something like this:
We're moving away from a hashie based config. If you're at this page this is the new interface for config:
# Put config interface docs here
If you can't find a valid method that does what you need to do, please open an issue on the tracker with the code you are trying to use and what you need to do.
from harvested.
Thanks @schneems. That's a good idea.
harvested is a pretty small gem, and I don't think this will be as big of an impact as compared to something like https://rubygems.org/gems/twitter. I think it'd be a good idea to release your idea with v3.2.0 just to help inform folks still on that major version line. At the same time we can release v4.0 which actually removes Hashie.
harvested isn't using Mash for configuration. We're returning all entities from the API as a Mash. But your point still stands.
from harvested.
No sense in keeping this issue alive for 3 more years. Closing.
from harvested.
Related Issues (20)
- time_by_user report broken HOT 1
- Remove non-SSL option HOT 2
- time_by_user hardcodes options HOT 2
- Getting a 404 on all tasks HOT 1
- 404 on time_by_user HOT 5
- Uninitialized constant Harvest::OAuthCredentials HOT 3
- Wrong number of arguments (1 for 3..4) HOT 3
- 500 Harvest Internal Server error HOT 1
- Loosen dependency on Hashie HOT 4
- Locking time entries via API? HOT 1
- Mark a time_entry as invoiced HOT 1
- Duplicated key's in timezones.rb
- Company info HOT 2
- Unexpected results from filtering .all HOT 1
- Get expenses for a date range HOT 3
- csv_line_items not returned for invoice(s) HOT 2
- I am interested in maintaining harvested. HOT 1
- External Reference URL HOT 2
- Harvested and the V2 Harvest API HOT 4
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 harvested.